Using Python to kick off Python subprocesses without delay
<p>I want to launch multiple instances of a python script using <code>subprocess.call</code>, but the kick off script waits for each to complete. How do I prevent it from waiting from going one by one, without waiting for the previous job to complete?</p>

<pre><code>step = 5
for n in range(5, 11, step):
    subprocess.call(["python", cwd + "/" + "subprocess.py", str(n - step), str(n)])
</code></pre>

<p>From the <code>subprocess</code> documentation (emphasis mine):</p>

<ul>
<li>Run command with arguments. <strong>Wait for command to complete</strong>, then return the returncode attribute.</li>
</ul>

<p>Consider using <a href="https://docs.python.org/2.6/library/subprocess.html#subprocess.Popen" rel="nofollow"><code>Popen</code></a> instead (see also <a class='doc-link' href="http://stackoverflow.com/documentation/python/1393/subprocess-library/5714/advanced-usage-with-popen#t=201609020209559169763">stackoverflow documentation</a>).</p>

python concurrency subprocess