python 定时任务之 schedule
import schedule
import time
def task():
print("任务启动了!")
# 安排任务在16:59:59运行
schedule.every().day.at("16:59:59").do(task)
while True:
schedule.run_pending()
time.sleep(1)
import schedule
import time
def task():
print("任务启动了!")
# 安排任务在16:59:59运行
schedule.every().day.at("16:59:59").do(task)
while True:
schedule.run_pending()
time.sleep(1)