📌  相关文章
📜  如何让 python 每隔 x 秒做一些事情 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:16.976000             🧑  作者: Mango

代码示例1
import sched, time
s = sched.scheduler(time.time, time.sleep)
def do_something(sc): 
    print("Doing stuff...")
    # do your stuff
    s.enter(60, 1, do_something, (sc,))

s.enter(60, 1, do_something, (s,))
s.run()