python简单线程,没输出,有大神帮忙看一下吗?
import threadingclass ThreadClass:
def __init__(self,num):
self.num = num
def run(self):
print("this is def",self.num)
n=['a','b','c','d','e']
lis=[]
for i in n:
th = threading.Thread(target=ThreadClass, args=(i))
lis.append(th)
for t in lis:
t.start()
for t in lis:
t.join()
这个代码没输出,也没报错