Restart/rerun the main.py script automatically

This will rerun or re-execute the main.py script automatically once it disrupted or killed by any error.
When I try to execute the main script multiple times by using TIMES_TO_RUN="n" feature sometimes the script stopped by some errors like timeout or sox not found, then I need to restart the script again and again so I wrote this to automate the restarting part.if anyone wants to rerun the script for n number of times then they can by rewriting the while loop to run exactly n times.
pull/672/head
J BORGOHAIN 3 years ago committed by GitHub
parent 0db05aa683
commit d19c95acac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,6 @@
import os
while 1:
os.system("python3 main.py")
print("Restarting......")
# if you want to restart the main Script automatically 'n' number of times then rewrite the while loop to run 'n' times.
Loading…
Cancel
Save