title: Stream input from terminal to Python script
body: <p>I have a log file on my server and I am using a CLI Program to fetch the content to terminal. I need to do a bit of filtering and json operation and I am more comfortable in doing that in python rather than in some bash script. Now my question is is there a way to pipe the stream to python? </p>
  
  <p>something like this </p>
  
  <pre><code>cliProgram fetchLogs | python script.py 
  </code></pre>
  
  <p>In Python, I want to parse the content line by line so python file should have a way to read the data line by line and if data is not available (may be because of network delay) , it should wait for more data and exit only when the stream is closed.</p>