Python定时调度

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python定时调度相关的知识,希望对你有一定的参考价值。

from datetime import datetime
from apscheduler.schedulers.blocking import BlockingScheduler


def tick():
    print(datetime.now())


if __name__ == ‘__main__‘:
    scheduler = BlockingScheduler()
    scheduler.add_job(tick, ‘interval‘, seconds=1.0000000)

    scheduler.start()

  

以上是关于Python定时调度的主要内容,如果未能解决你的问题,请参考以下文章