subprocess.call and ending current program
<p>My main program checks if a new version of itself is available and if so it downloads the new installer file and runs it:
<code>subprocess.call(["installer.exe"], shell=True)</code>
But in order to overwrite the old files, it needs to exit itself after calling the subprocess. How can I achieve this?</p>

<p>In Windows, just <code>start</code> your installer program instead of waiting for it.</p>

<pre><code>import subprocess

subprocess.call(["start","installer.exe"],shell=True)
print("out")
</code></pre>

<p>Running this will print <code>out</code> immediately and returns to the console if this is the last statement (or call <code>sys.exit()</code>)</p>

python subprocess