python 版本3.8,
import threading
p=threading.Thread(fun,args=())
其中入口函数fun 是否应该有返回值?
答不建议有返回值,因为即使有返回值,主线程获得的值一样是NoneType,也是无效的,其中返回值的方式是return,而不是yield,fun 中使用yield,有可能fun函数根本不执行
python 版本3.8,
import threading
p=threading.Thread(fun,args=())
其中入口函数fun 是否应该有返回值?
答不建议有返回值,因为即使有返回值,主线程获得的值一样是NoneType,也是无效的,其中返回值的方式是return,而不是yield,fun 中使用yield,有可能fun函数根本不执行