title: How to take input file from terminal for python script?
body: <p>I have a python script which uses a text file and manipulate the data from the file and output to another file. Basically I want it to work for any text file input. Right now I readline from the file and then print the output to screen. I want the output in a file.</p>
  
  <p>So user can type the following and test for any file:</p>
  
  <pre><code>cat input_file.txt | python script.py &gt; output_file.txt.
  </code></pre>
  
  <p>How can I implement this in my script? Thank You.</p>
  
  <p>cat is command in linux. I don't know how it works.</p>