title: run subprocesses in parallel
body: <p>I have a python script which has to call a certain app 3 times. These calls should be parralel since they take hours to complete and arent dependant on eachother. But they script should halt until all of them are complete and then do some clean up work.</p>
  
  <p>Here is some code:</p>
  
  <pre><code>#do some stuff
  
  for work in worklist:   # these should run in parralel
      output=open('test.txt','w')
      subprocess.call(work,stdout=output,stderr=output)
      output.close()
  
  # wait for subprocesses to finish
  
  # cleanup
  </code></pre>
  
  <p>so I basically want to run this command in parrelel while capturing its output to a file. once all instances are done I want to continue the script</p>