class Mythreading(threading.Thread): def __init__(self,num): threading.Thread.__init__(self) self.num = num def run(self): print("这是线程哦",self.num) time.sleep(2) t1 = Mythreading(1) t2 = Mythreading(2) t1.start() t2.start()
创建线程方式
猜你喜欢
转载自www.cnblogs.com/TKOPython/p/12435832.html
今日推荐
周排行