python多线程示例
时间: 2023-02-19 17:14:52 浏览: 53
Python多线程示例
我可以为你提供一个关于Python多线程的示例:
import threading
def worker():
"""thread worker function"""
print('Worker')
return
threads = []
for i in range(5):
t = threading.Thread(target=worker)
threads.append(t)
t.start()
阅读全文