teddy 96e67e8b04 feat: 初始化微信自动消息发送项目
添加项目基础文件结构,包括:
- README.md 占位文件
- Python 版本配置文件
- gitignore 配置
- 项目配置文件
- 项目依赖配置
- 定时任务调度器
- 微信消息发送主逻辑
- 飞书消息通知功能
2025-06-20 17:39:03 +08:00

19 lines
431 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)