Restarting a self-updating python script

Viewed 43151

I have written a script that will keep itself up to date by downloading the latest version from a website and overwriting the running script.

I am not sure what the best way to restart the script after it has been updated.

Any ideas?

I don't really want to have a separate update script. oh and it has to work on both linux/windows too.

8 Answers

Wouldn't it just be easier to do something like Very simple, no extra imports needed, and compatible with any OS depending on what you put in the os.system field

def restart_program():
  print("Restarting Now...")
  os.system('your program here')
Related