import time
def countdown(n):
while n>0:
print('T-minus',n)
n-=1
time.sleep(2)
from threading import Thread
t = Thread(target=countdown, args=(10,))
t.start()
print('TTTTT')
while True:
if t.is_alive():
print('Still alive')
time.sleep(1)
else:
print('Completed')
break
python Thread
最新推荐文章于 2021-10-13 09:35:42 发布