python多线程简单例子

python多线程简单例子

python多线程简单例子


作者:vpoet

mail:[email protected]

 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多线程简单例子-LMLPHP

04-14 16:38