摘要:
thread 对外提供的常用方法有:start_new_thread:创建新线程e.g. 看下面的示例更容易理解thread的线程机制:import timeimport threadfrom time import ctimedef timer(i, interval): while True: print "id:%s, time:%s \n"%(i, ctime()) time.sleep(interval)def test(): for i in range(5): thread.start_new_thread(timer, (i... 阅读全文