python——gevent

import gevent
from gevent import monkey
import time
monkey.patch_all()
def func1():
print("111111")
time.sleep(1)

def func2():
print("2222")
time.sleep(1)

def func3():
print("3333")
time.sleep(1)

g1=gevent.spawn(func1)
g2=gevent.spawn(func2)
g3=gevent.spawn(func3)
g1.join()
g3.join()
g2.join()
print("我结束了")

原文地址:https://www.cnblogs.com/shunguo/p/14477036.html