摘要: 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... 阅读全文
posted @ 2013-06-13 15:40 践道者 阅读(264) 评论(0) 推荐(0) 编辑