Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I downloaded a python script but I have a problem with the script, the problem is that it stops working but when I stop the program and rerun it it has a good feature to resume the process which was terminated last time and it continues the process for some time but again stops working. So,

I want to create an another script which terminates the real python script and reruns it every 5 mins...

but when the real python script starts it asks if we want to continue the old terminated process and we have to enter 'y'...

Can anyone help me with this and you can use any language to create the rerunning script. ThankYou


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
176 views
Welcome To Ask or Share your Answers For Others

1 Answer

I agree that you might add try-catch clauses, but replying to your question, you can use subprocess library

import subprocess
subprocess.call(["python", "your_script.py"])

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...