args参数是元组,该多线程调用的参数
kwargs参数是字典,字典键值对是该多线程调用的参数形参-值
import threading
import time
def song(a,b,c):
print(a,b,c)
for i in range(5):
print('song')
time.sleep(1)
if __name__ == '__main__':
# threading.Thread( target = song,args = (1,2,3)).start()
# threading.Thread( target = song,kwargs={'a':1,'c':3,'b':2}).start()
threading.Thread( target = song,args=(1,),kwargs={ 'c':3,'b':2}).start()
网友评论