shutdown main.py while in another file code example
Example: how to reboot a python script
import os
while 1:
os.system("python main.py")
print "Restarting..."
exit()
import os
while 1:
os.system("python main.py")
print "Restarting..."
exit()