- 将定时任务时间从12:00改为14:39 - 新增start_scheduler.bat脚本用于管理进程 - 在config.py中添加messages_reciever配置项 - 优化sendmsg.py代码结构,使用配置项代替硬编码
36 lines
762 B
Python
36 lines
762 B
Python
from wxauto import WeChat
|
|
from datetime import date
|
|
import sys
|
|
import os
|
|
import subprocess
|
|
import json
|
|
from config import CONFIG
|
|
import time
|
|
from config import CONFIG
|
|
|
|
|
|
today = date.today()
|
|
formatted_date = today.strftime('%Y-%m-%d')
|
|
file_name = formatted_date+".png"
|
|
file_path = CONFIG['file_path']+file_name
|
|
try:
|
|
wx = WeChat()
|
|
except:
|
|
subprocess.run([sys.executable, 'send_openmsg.py'])
|
|
sys.exit(1)
|
|
|
|
|
|
msg = 'hello, wxauto!'
|
|
who = CONFIG['messages_reciever']
|
|
|
|
if os.path.isfile(file_path):
|
|
error_msg = ""
|
|
else:
|
|
error_msg = "没找到指定文件"
|
|
subprocess.run([sys.executable, 'send_filemsg.py'])
|
|
sys.exit(1)
|
|
|
|
print("找到了指定文件!")
|
|
wx.SendFiles(filepath=file_path, who="File Transfer")
|
|
wx.SendMsg(msg=msg, who=who)
|