title: Python: Howto launch a full process not a child process and retrieve the PID
body: <p>I would like:</p>
  
  <ol>
  <li>Launch a new process (myexe.exe arg1) from my process (myexe.exe arg0)</li>
  <li>Retrieve the PID of this new process (os windows)</li>
  <li>when I kill my first entity (myexe.exe arg0) with the TaskManager Windows Command "End process tree", I need that the new one (myexe.exe arg1) will not be killed...</li>
  </ol>
  
  <p>I've played with subprocess.Popen, os.exec, os.spawn, os.system... without success.</p>
  
  <p>Another way to explain the problem: How to protect myexe.exe (arg1) if someone kills the "process tree" of the myexe.exe (arg0)?</p>
  
  <p>EDIT: same question (without answer) <a href="https://stackoverflow.com/questions/13592219/launch-a-totally-independent-process-from-python">HERE</a></p>
  
  <p>EDIT: the following command do not guarantee the Independence of the subprocess</p>
  
  <pre><code>subprocess.Popen(["myexe.exe",arg[1]],creationflags = DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP,close_fds = True)
  </code></pre>