- 将定时任务时间从12:00改为14:39 - 新增start_scheduler.bat脚本用于管理进程 - 在config.py中添加messages_reciever配置项 - 优化sendmsg.py代码结构,使用配置项代替硬编码
19 lines
431 B
Python
19 lines
431 B
Python
import schedule
|
||
import time
|
||
import subprocess
|
||
import sys
|
||
import os
|
||
|
||
def run_sendmsg():
|
||
script_path = os.path.join(os.path.dirname(__file__), 'sendmsg.py')
|
||
subprocess.run([sys.executable, script_path])
|
||
|
||
# 设置每天12点运行
|
||
schedule.every().day.at("14:39").do(run_sendmsg)
|
||
|
||
print("定时任务已启动,将在每天12:00运行sendmsg.py")
|
||
|
||
# 保持程序运行
|
||
while True:
|
||
schedule.run_pending()
|
||
time.sleep(1) |