title: Python subprocess: how to use pipes thrice?
body: <p>I'd like to use subprocess on the following line:</p>
  
  <pre><code>convert ../loxie-orig.png bmp:- | mkbitmap -f 2 -s 2 -t 0.48 | potrace -t 5 --progress -s -o ../DSC00232.svg
  </code></pre>
  
  <p>I found thank to other posts <a href="http://docs.python.org/library/subprocess.html#replacing-shell-pipeline" rel="noreferrer">the subprocess documentation</a> but in the example we use only twice pipe.</p>
  
  <p>So, I try for two of the three commands and it works</p>
  
  <pre><code>p1 = subprocess.Popen(['convert', fileIn, 'bmp:-'], stdout=subprocess.PIPE)
  # p2 = subprocess.Popen(['mkbitmap', '-f', '2', '-s', '2', '-t', '0.48'], stdout=subprocess.PIPE)
  p3 = subprocess.Popen(['potrace', '-t' , '5', '-s' , '-o', fileOut], stdin=p1.stdout,stdout=subprocess.PIPE)
  p1.stdout.close()  # Allow p1 to receive a SIGPIPE if p3 exits.
  output = p3.communicate()[0]
  </code></pre>
  
  <p>Can you help me for the third command?</p>
  
  <p>Thank you very much.</p>