title: Restart python-script from within itself
body: <p>I have a python-based GTK application that loads several modules. It is run from the (linux) terminal like so:</p>
  
  <p><code>./myscript.py --some-flag setting</code></p>
  
  <p>From within the program the user can download (using Git) newer versions.
  If such exists/are downloaded, a button appear that I wish would restart the program with newly compiled contents (including dependencies/imports). Preferably it would also restart it using the contents of <code>sys.argv</code> to keep all the flags as they were.</p>
  
  <p>So what I fail to find/need is a nice restart procedure that kills the current instance of the program and starts a new using the same arguments.</p>
  
  <p>Preferably the solution should work for Windows and Mac as well but it is not essential.</p>