import sys
import datetime
import os
import time
if name ="_ main__":
while 1:
startTime=datetime.datetime.now()
main_path="./main.py"
py=sys.executable
os.system(r"{} {} {} {}".format(py, main_path, sys.argv[1],sys.argv[2]))
time.sleep(120)
endTime = datetime.datetime.now()
if endTime-startTime>60*60:
break
is that the script may have been running for too long, and I judged that if it is still running within a long time, I will kill him
sources of topics and their own ideas
related codes
/ / Please paste the code text below (do not replace the code with pictures)