标签:play tin 协程 style 结果 import gevent end start
from gevent import monkey;monkey.patch_all() import time import gevent def eat(): print("eating start") time.sleep(2) print("eating end") def play(): print("playing start") gevent.sleep(1) print("playing end") g1 = gevent.spawn(eat) g2 = gevent.spawn(play) g1.join() g2.join() 输出结果: eating start playing start playing end eating end
标签:play tin 协程 style 结果 import gevent end start
原文地址:https://www.cnblogs.com/superniao/p/10128644.html