【发布时间】:2017-08-16 08:55:37
【问题描述】:
代码如下:
import threading
import time
def fun_01() :
timer = threading.Timer(3,call_back)
print("start~")
timer.start()
#If the call_back function is executed after 3 seconds,
# the fun_01 function must be terminated (before 10 seconds have elapsed)
print("waiting")
time.sleep(5)
print("end wait")
print("Hello~")
return "exit"
def call_back():
print("call_back")
return "end"
print(fun_01())
如果call_back函数在3秒后执行, fun_01 函数必须终止(在 10 秒之前) .......帮帮我
【问题讨论】:
标签: python multithreading python-3.x function