how to reboot a python script

Do you want to know the details regarding “how to reboot a python script”. If yes, you’re in the correct post.

how to reboot a python script

sys.stdout.flush()
os.execl(sys.executable, 'python', __file__, *sys.argv[1:])
import os

while 1:
    os.system("python main.py")
    print "Restarting..."
    exit()
import os

os.system("python main.py")
exit()

Final Thoughts

I hope this tutorial helps you to know about “how to reboot a python script”. If you have any doubts regarding this article please let us know via the comment section. Share this article with your friends and family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment