踩坑记录:在实际中遇到的问题 python报错ValueError: generator already executing
lists = ['30', '60', '90', '120', '500', '700']
for nums in lists:
print(nums,'*********************')
T1 = threading.Thread(target=activation_box,args=(nums,))
# sleep(3)
T2 = threading.Thread(target=activation_box_show,args=(nums,))
# T1 = threading.Thread(target=activation_box,args=('30'))
T1.start()
T2.start()
threadLock = threading.Lock()
threads = []
threads.append(T1)
threads.append(T2)
# 等待所有线程完成
for t in threads:
t.join()
print ("退出主线程")
sleep(1)
需要添加锁