既然定时,很明显我要放服务器上定时(
这是demo)
参考改就好了——
#coding=utf-8 """ 作者:川川 qq:2835809579 时间:2021/6/21 """ from datetime import datetime import time from apscheduler.schedulers.blocking import BlockingScheduler scheduler = BlockingScheduler() from apscheduler.triggers.cron import CronTrigger def a(): print('1\n') def b(): print('2\n') def c(): print('3\n') def d(): print('4\n') if __name__ == '__main__': scheduler = BlockingScheduler() trigger1 = CronTrigger(hour='23', minute='0-10') scheduler.add_job(a, trigger1) trigger2 = CronTrigger(hour='23', minute='0-10') scheduler.add_job(b, trigger2) trigger3 = CronTrigger(hour='23', minute='0-10') scheduler.add_job(c, trigger3) trigger4 = CronTrigger(hour='23', minute='0-10') scheduler.add_job(d, trigger4) try: scheduler.start() except (KeyboardInterrupt, SystemExit): print('执行错误') ''':cvar 参考文章:https://blog.csdn.net/hush19/article/details/89634380 '''