摘要:
1 from gevent import monkey,spawn;monkey.patch_all() 2 from threading import current_thread 3 import time 4 # 实现了单线程下的并发,遇到i/O就切换 5 def eat(): 6 print 阅读全文
摘要:
1.定时器 指定n秒后,执行任务 1 from threading import Timer,current_thread 2 import os 3 4 5 def hello(): 6 print("%s hello, world"%os.getpid()) 7 print("%s hello, 阅读全文