import subprocess DETACHED_PROCESS = 0x00000008 results = subprocess.Popen(['notepad.exe'], close_fds=True, creationflags=DETACHED_PROCESS) print(results.pid)
References
https://stackoverflow.com/questions/11585168/launch-an-independent-process-with-python