Python简单的多线程demo:装逼写法
2021-06-26 11:04
标签:self import threading class __init__ running code 简单的 线程 用面向对象来写多线程: Python简单的多线程demo:装逼写法 标签:self import threading class __init__ running code 简单的 线程 原文地址:https://www.cnblogs.com/staff/p/9656913.htmlimport threading
class MyThread(threading.Thread):
def __init__(self, n):
super(MyThread, self).__init__()
self.n = n
def run(self):
print("running task:",self.n)
t1 = MyThread("t1")
t2 = MyThread("t2")
t1.start()
t2.start()
上一篇:我要学python之入门基础