Python timed daily tasks

1.day_of_week = '0-6' # mon-sun

2. At the same time, combined with < automatic clocking >, the timing plan can be replaced with the python script implementation

3. For detailed introduction, please refer to < Feng Feifei >

from apscheduler.schedulers.blocking import BlockingScheduler


def job():
    print("hello")


if __name__ == '__main__':
    # BlockingScheduler
    scheduler = BlockingScheduler()
    scheduler.add_job(job, 'cron', day_of_week='0-6', hour=7, minute=35)
    scheduler.start()

Guess you like

Origin blog.csdn.net/qq_41854291/article/details/107912666