title: Restart compiled python script with pyinstaller
body: <p>I'm programming a little app with python+tkinter that shows a window with some widgets. The window read data from remote sources and in some situations I want the application restart (close+open). It works fine when executing python script (source code), but is not working when compiled to an exe file (pyinstaller --onfile --windowed).</p>
  <p>I've tried two ways, all two works perfectly in source code:</p>
  <ol>
  <li>os.execv(sys.argv[0], sys.argv)</li>
  <li>os.execv(sys.executable, ['python'] + sys.argv)</li>
  </ol>
  <p>When compiled to an exe, the application is closed but never restart. I've printed the values of argv to a log:</p>
  <p>sys.argv[0]=C:\Program Files (x86)\Grid Positions\gridpositions.exe, sys.argv=['C:\Program Files (x86)\Grid Positions\gridpositions.exe']</p>
  <p>The application is installed on C:\Program Files (x86)\Grid Positions, with correct writting permissions, using innosetup installer to make the setup.exe</p>