添加项目基础文件结构,包括: - README.md 占位文件 - Python 版本配置文件 - gitignore 配置 - 项目配置文件 - 项目依赖配置 - 定时任务调度器 - 微信消息发送主逻辑 - 飞书消息通知功能
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("12:00").do(run_sendmsg)
|
||
|
||
print("定时任务已启动,将在每天12:00运行sendmsg.py")
|
||
|
||
# 保持程序运行
|
||
while True:
|
||
schedule.run_pending()
|
||
time.sleep(1) |