线程创建方式与进程创建方式基本一致
from threading import Thread
import time
def test():
print("hello world")
time.sleep(1)
for x in range(5):
t = Thread(target = test)
t.start()
线程创建方式与进程创建方式基本一致
from threading import Thread
import time
def test():
print("hello world")
time.sleep(1)
for x in range(5):
t = Thread(target = test)
t.start()
转载于:https://www.cnblogs.com/ForXinYuanStudyPy/p/7718871.html