标签:自动 class eve python pip greenlet pytho nbsp from
手动协程操作:
# pip install gevent from greenlet import greenlet def test(): print(‘He ‘) gr2.switch() print(‘a ‘) gr2.switch() def test2(): print(‘is ‘) gr1.switch() print(‘student.‘) gr1 = greenlet(test) gr2 = greenlet(test2) gr1.switch()
2. 自动协程,遇到I/O自动切换
标签:自动 class eve python pip greenlet pytho nbsp from
原文地址:https://www.cnblogs.com/wztshine/p/12054120.html