title: Using pipes with the python "subprocess" module
body: <p>Let's say I want to call the program <em>theprogram</em> in a windows batch file. The code would look like this :</p>
  
  <pre><code>exit | theprogram arg1
  </code></pre>
  
  <p>I've tested it and it works perfectly, many thanks !</p>
  
  <p>Now, big change of strategy, I have to call <em>theprogram</em> inside a python script. For this I use the <em>subprocess</em> module. I get :</p>
  
  <pre><code>subprocess.call(['theprogram', arg1])
  </code></pre>
  
  <p>But for this to work correctly, I need to pipe this with an exit statement, as I did in the batch file. Of course, this <strong>doesn't</strong> work</p>
  
  <pre><code>subprocess.call(['exit | theprogram', arg1])
  </code></pre>
  
  <p>Does anyone know how I can correctly pipe this <em>exit</em> statement to the input of <em>theprogram</em> ?</p>
  
  <p>Thanks a lot !</p>