python多线程简单例子
作者:vpoet
日期:大约在夏季
注:无
import thread
def childthread(threadid):
print "I am child thread",threadid
def parentthread():
i=0
while 1:
i+=1
thread.start_new_thread(childthread,(i,))
if raw_input()=='q':
break
parentthread()
运行截图:

本文提供了一个简单的Python多线程实例,通过定义线程函数和启动新线程来实现多任务并行处理。
574

被折叠的 条评论
为什么被折叠?



