title: Background Process subprocess.Popen with Pipe
body: <p>I'm trying to record and convert a stream with python using arecord.</p>
  
  <p>In the shell this is a command more or less like:</p>
  
  <pre><code>arecord -B 5000 -f dat | lame -m j -q 5 -V 2 - test.mp3 &amp;
  </code></pre>
  
  <p>In Python I tried this with subprocess.Popen:</p>
  
  <pre><code>reccmd = ["arecord", "-B", "5000", "-f", "dat"]
  mp3cmd = ["lame", "-m", "j", "-q", "5", "-V", "2", "-", "test.mp3"]
  p = subprocess.Popen(reccmd, stdout=subprocess.PIPE)
  p2 = subprocess.Popen(mp3cmd, stdin=p.stdout)
  p2.communicate()
  </code></pre>
  
  <p>But I don't know how to include the "&amp;" or something similar in the code to be able to stop the recording with a </p>
  
  <p><code>killall arecord</code> command</p>