python多线程threading.Thread传关键字参数(**kwargs)的时候要用字典

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/AlanGuoo/article/details/88131761
import threading

def task(self, call_back):

	self.download()

	if call_back:
		# 回调pbms
		self.call_back()

def main(self, call_back=True):

       # gevent.spawn(self.download, call_back).join()
	threading.Thread(target=self.task, args=(call_back,)).start()
	## 或者
	threading.Thread(target=self.task, kargs=({'call_back':call_back}).start()
展开阅读全文

没有更多推荐了,返回首页