title: How to run Python subprocess consistently and in parallel?
body: <p>I wrote a python script that converts <code>mp3</code> to <code>wav</code> with <code>mpg123</code>. Then <code>ffmpeg</code> takes the output of <code>mpg123</code> and upsample it. Finally, <code>ffmpeg</code> output file uploads to cloud. All these steps must run consistently.</p>
  <pre><code>subprocess.run(['mpg123', ...])
  subprocess.run(['ffmpeg', ...])
  upload()
  </code></pre>
  <p>Suppose, I have many <code>mp3</code> files and I'd like to run 10 threads at the same time. I know that Python offers threading in <code>subprocess.Popen</code>, <code>threading</code>, <code>concurrent.futures</code> and <code>multiprocessing</code> modules. What is the right way to parallelize this process?</p>