first commit

This commit is contained in:
dongchangxi committed 2024-12-27 10:43:26 +08:00
1 parent f20f6f3c34
commit 7a2b784979
36 files changed
+712 -3566

No files matched your search

+23 -5
View File
@@ -1,8 +1,26 @@
import time,os
import os
import time as t
from datetime import datetime, time
def is_time_in_range(start_time_str, end_time_str):
# 获取当前时间
now = datetime.now().time()
# 转换字符串时间为时间对象
start_time = datetime.strptime(start_time_str, '%H:%M').time()
end_time = datetime.strptime(end_time_str, '%H:%M').time()
# 检查当前时间是否在指定范围内
return start_time <= now <= end_time
if __name__ == '__main__':
start_time_str = '07:00'
end_time_str = '23:59'
#开启死循环
while True:
#检测当前打印 和 脚底板 和 gs 队列长度
os.system("python E:\\make2\\tools\\push_cmd.py auto_view")
#一个小时检测一次
time.sleep(60*60)
#判断当前时间是否在 8:00-20:00 之间
if is_time_in_range(start_time_str, end_time_str):
#检测当前打印 和 脚底板 和 gs 队列长度
os.system("python E:\\make2\\tools\\push_cmd.py auto_view")
#一个小时检测一次
t.sleep(60*60)