python---继承的方式启动线程
import threading,time
class MyThread(threading.Thread):
def __init__(self,name):
super().__init__()
self.name = name
def run(self):
time.sleep(1)
# print("%s创建数据"%self.name)
print("创建数据")
for i in range(5):
t = MyThread("name")
t.start()

浙公网安备 33010602011771号