python 多线程非常简单。
关键的使用点就是 :
threading.Thread(target=函数名).start()
#多线程例子
from time import ctime,sleep
import threading
def music():
for i in range(5):
print("听歌. %s" %ctime())
sleep(1)
def move():
for i in range(3):
print("看片! %s" %ctime())
sleep(2)
def run():
t1=threading.Thread(target=music)
t1.start()
t2=threading.Thread(target=move)
t2.start()
run()