一.通过类创建子线程 import threading class MyThread(threading.Thread): def __init__(self,num): threading.Thread.__init__(self) self.num = num def run(self): print('running on number %s' %self.num) if __name__ == '__main__': t1 = MyThread(1) t2 = MyThread(2) t