一 代码
from threading importThread
import time
def func1():
time.sleep(10)
t1=Thread(target=func1)
print('t1:',t1.isAlive())
t1.start()
print('t1:',t1.isAlive())
t1.join(5)
print('t1:',t1.isAlive())
t1.join()
print('t1:',t1.isAlive())
二 运行结果
E:\python\python可以这样学\第13章 多线程与多进程编程\code>python ThirdExample.py
t1: False
t1: True
t1: True
t1: False