title: python execute subprocess without waiting for subprocess to terminate
body: <p>Is it possible to start subprocess without waiting for it to terminate?
  I have a Windows program that I need to execute in python script and I want to leave it run on background without waiting for the subprocess to quit since the program is expecting input to terminate itself (press q to quit).</p>
  
  <p>I have tried many ways but none of them worked.</p>
  
  <p>What I basically want to achieve is the following:</p>
  
  <pre><code>args = [os.path.join(path, 'myProgram.exe'), '/run']
  
  p = subprocess.Popen(args) 
  </code></pre>
  
  <p>and do some other stuff here with the myProgram.exe still running.</p>
  
  <p>The myProgram.exe can also be installed as service. When I tried this approach by</p>
  
  <pre><code>subprocess.call('net start myService', shell=True)
  </code></pre>
  
  <p>the service always fails to start. It fails with system error code 1067 which means the process terminated unexpectedly.</p>
  
  <p>NOTE: I'm using python 2.7</p>
  
  <p>Thanks for the advices.</p>
  
  <p>Edit:
  I have found a workaround which I don't understand...
  As workaround I've created a myProgram.bat file which starts myProgram.exe.
  BUT there's a catch, if I do only </p>
  
  <blockquote>
    <p>start myProgram.exe</p>
  </blockquote>
  
  <p>it behaves exactly the same as when calling subprocess - it terminates. However if I do</p>
  
  <blockquote>
    <blockquote>
      <p>timeout 0 -- @means wait 0 seconds</p>
      
      <p>start myProgram.exe</p>
    </blockquote>
  </blockquote>
  
  <p>the program starts normally.</p>