title: Redirect bash output to python script
body: <p>I am using <strong>zbarimg</strong> to scan bar codes, I want to redirect the output to a python script. How can I redirect the output of the following command:</p>
  
  <pre><code>zbarimg code.png
  </code></pre>
  
  <p>to a python script, and what should be the script like?</p>
  
  <p>I tried the following script:</p>
  
  <pre><code>#!/usr/local/bin/python
  s = raw_input()
  print s
  </code></pre>
  
  <p>I made it an executable by issuing the following:</p>
  
  <pre><code>chmod +x in.py
  </code></pre>
  
  <p>Than I ran the following :</p>
  
  <pre><code>zbarimg code.png | in.py
  </code></pre>
  
  <p>I know it's wrong but I can't figure out anything else!</p>