##多线程import threading
import time
defthread01(args):for i in range(1,10):
print"thread 01 ",args," ",i
time.sleep(1)
defthread02(args):for i in range(1,10):
print"thread 02 ",args," ",i
time.sleep(1)
threads=[]
##注意一定args=(u'one',) 一个参数时候一定要加上,##传入的参数要求是tuple,在python用(1,)表示一个tuple
t1=threading.Thread(target=thread01,args=(u'one',))
t2=threading.Thread(target=thread02,args=(u'two',))
threads.append(t1)
threads.append(t2)
for i in threads:
# i.setDaemon(True)
i.start()
print"main"