python 定时运行指定py程序

import time,os
from datetime import date ,datetime
import schedule
def tick():
    print("tick ! the time is : %s" % datetime.now())
    os.system("python ka011b.py")
    #print("123")
schedule.every().day.at("04:04").do(tick,)
while True:
    schedule.run_pending()   #run_pending:运行所有可以运行的任务

 

posted @ 2022-10-18 08:44  myrj  阅读(123)  评论(0编辑  收藏  举报