我有两个单独的Python脚本和一个主脚本:
在脚本.py
脚本b.py
主.py
我想跑scripA.py文件早上5点到12点,脚本从12点到下午5点。我想为我写一个剧本。目前我正试图通过主.py. 但什么都没用。我真正想要的是这样的东西。在
if time betwee 5am and 12am:
if scriptB running:
stop scriptB
execute scriptA
else:
execute scriptA
if time between 12:01am and 4:99:
if scriptA running:
stop scriptA
execute scriptB
else:
execute scriptB
如果你有任何其他的建议来实现上述功能,请告诉我。在
以下是一个未经测试的想法,希望得到反馈。一般的想法是根据当前时间检查要运行的程序,然后等待时间切换。在
代码:
请评论任何问题或让我知道如果你已经尝试实施它的工作。在
相关问题 更多 >
编程相关推荐