发布时间:2019-09-06 08:53:45编辑:auto阅读(2101)
import threading
def fun_timer():
print('Hello Timer!')
timer = threading.Timer(1, fun_timer)
timer.start()
"""Call a function after a specified number of seconds"""
一段时间后调用一个函数,但并没有说要循环调用该函数。因此,修改如下:def fun_timer():
print('Hello Timer!')
global timer
timer = threading.Timer(5.5, fun_timer)
timer.start()
timer = threading.Timer(1, fun_timer)
timer.start()
print(type(fun_timer()))
print(type(fun_timer))
# -*- coding: utf-8 -*-
import threadingimport time
上一篇: scala调用python
下一篇: python 中的嵌套类
50972
50354
40970
37837
32302
29193
28079
22909
22871
21203
1072°
1746°
1431°
1364°
1634°
1451°
2110°
3657°
3584°
2528°