title: How redirect a shell command output to a Python script input ?
body: <p>This is probably something really basic, but I can not find a good solution for it.
  I need to write a python script that can accept input from a pipe like this:</p>
  
  <pre><code>$ some-linux-command | my_script.py
  </code></pre>
  
  <p>something like this:</p>
  
  <pre><code>cat email.txt | script.py
  </code></pre>
  
  <p>Or it will just be piped by my .forward file directly from sendmail. This means that the input file might be something relatively large if it has an attachment, and it will probably be an e-mail, later I will have to put in a database the sender, the subject and such, but I have written database scripts in python, so that part will be OK. 
  The main problem is how to capture the data flowing in from the pipe.</p>