1. 协程的创建.
#线程的创建
from threading import Thread
import time
def sayhi(name):
time.sleep(2)
print("%s say hello"%name)
if __name__ =="__main__":
t =Thread(target=sayhi,args =("egon",))
t.start()
print("主线程")
原文:https://www.cnblogs.com/mengbin0546/p/10205603.html