title: Start another program and leave it running when the script ends
body: <p>I'm using subprocess.Popen to launch an external program with arguments, but when I've opened it the script is hanging, waiting for the program to finish and if I close the script the program immediately quits.</p>
  
  <p>I thought I was just using a similar process before without issue, so I'm unsure if I've actually done it wrong or I'm misremembering what Popen can do. This is how I'm calling my command:</p>
  
  <pre><code>    subprocess.Popen(["rv", rvFile, '-nc'])
      raw_input("= Opened file")
  </code></pre>
  
  <p>The raw_input part is only there so the user has a chance to see the message and know that the file should be opened now. But what I end up getting is all the information that the process itself is spitting back out as if it were called in the command line directly. My understanding was that Popen made it an independent child process that would allow me to close the script and leave the other process open.</p>
  
  <p>The linked duplicate question does have a useful answer for my purposes, though it's still not working as I want it.</p>
  
  <p><a href="https://stackoverflow.com/a/2251026/4374739">This is the answer.</a> And this is how I changed my code:</p>
  
  <pre><code>DETACHED_PROCESS = 0x00000008
  pid = subprocess.Popen(["rv", rvFile, '-nc'], creationflags=DETACHED_PROCESS).pid
  raw_input("= Opened file")
  </code></pre>
  
  <p>It works from IDLE but not when I run the py file through the command prompt style interface. It's still tied to that window, printing the output and quitting the program as soon as I've run the script.</p>