title: Python on Windows - how to wait for multiple child processes?
body: <p>How to wait for multiple child processes in Python on Windows, without active wait (polling)? Something like this <em>almost</em> works for me:</p>
  
  <pre><code>proc1 = subprocess.Popen(['python','mytest.py'])
  proc2 = subprocess.Popen(['python','mytest.py'])    
  proc1.wait()
  print "1 finished"
  proc2.wait()
  print "2 finished"
  </code></pre>
  
  <p>The problem is that when <code>proc2</code> finishes before <code>proc1</code>, the parent process will still wait for <code>proc1</code>. On Unix one would use <code>waitpid(0)</code> in a loop to get the child processes' return codes as they finish - how to achieve something like this in Python on Windows?</p>