设置时间限制,等待任务结束
作者:互联网
设置时间限制,等待任务结束
import time
print('start task and wait')
waitflag = 0
timeline = 10
while True:
time.sleep(60)
print('check process and get result')
task_reslut = True
if task_reslut:
waitflag += 1
else:
waitflag = 0
if waitflag >= timeline:
print('task end success')
break
标签:waitflag,task,限制,True,time,设置,timeline,print,等待 来源: https://www.cnblogs.com/hui-code/p/15450370.html