Search code examples
pythonwindowsprocesssubprocesspywin32

python + windows: run exe as if it's unrelated to the current process


I know I can use subprocess.Popen to run an executable, and potentially redirect stdin and stdout to files / using pipes to my process. Is there a way to run an executable such that the spawned process has no relation to the current Python process, however? Meaning, I want to start a process in the same way as if I would double-click on the .exe, or type in its name into Start->Run...


Solution

  • On Windows, see os.startfile().