Python 2.7 Windows Fork and Disown

Viewed 47

I have a Windows, Python 2.7 application that needs to:

  1. change directory,
  2. open an application in that directory (using fork or something similar, which disowns the process), then
  3. exit the script (WITHOUT killing the subprocess).

Any ideas? My attempt below did not work... It just kills notepad!

import os, subprocess
os.chdir('C:/')
p = subprocess.Popen("notepad.exe", close_fds = True, creationflags = 0x00000008 | subprocess.CREATE_NEW_PROCESS_GROUP)

P.s. Yes, I'm aware Python 2.7 is no longer supported. Unfortunately, some commercial applications have been stranded on that platform with compiled code, and we're stuck with it...

0 Answers
Related