标签:bsp start 实例 进程 实现 init run import style
进程实例:
import threading
import time
def run(n):
print("task",n)
time.sleep(2)
t1 = threading.Thread(target=run,args = ("t1",))
t2 = threading.Thread(target=run,args = ("t2",))
t1.start()
t2.start()
多线程实现方法:
class MyThread(threading.Thread):
def __init__(self,n):
super(MyThread,self).__init__()
self.n = n
def run(self):
print("runint task",self.n)
t1 = MyThread("t1")
t1.run()
标签:bsp start 实例 进程 实现 init run import style
原文地址:https://www.cnblogs.com/fgxwan/p/9639785.html