2024-11-01 16:38:21 +08:00
|
|
|
|
# 定时执行cmd命令
|
|
|
|
|
import os
|
|
|
|
|
import time
|
|
|
|
|
from main import predict_main
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
try:
|
|
|
|
|
print(time.strftime('%H:%M'))
|
|
|
|
|
# 判断是不是工作日且 是17:00 7:00 才执行
|
|
|
|
|
if time.strftime('%A') not in ['Saturday', 'Sunday'] and time.strftime('%H:%M') in [ '18:00']:
|
|
|
|
|
predict_main()
|
|
|
|
|
time.sleep(60)
|
|
|
|
|
except:
|
2024-11-08 11:18:40 +08:00
|
|
|
|
time.sleep(3600)
|
|
|
|
|
predict_main()
|