简单示例代码:
import threading class MyThread(threading.Thread): def __init__(self,num): super(MyThread,self).__init__() self.num = num def run(self): print(self.num) mt = MyThread(3) mt.start()
时间: 2024-12-20 01:22:57
简单示例代码:
import threading class MyThread(threading.Thread): def __init__(self,num): super(MyThread,self).__init__() self.num = num def run(self): print(self.num) mt = MyThread(3) mt.start()