title: Universal construct for STDIN and Fileinput in Python Code
body: <p>I want my code to be able to accept input from a file AND stdin.
  What's the construct to do it?</p>
  
  <p>I mean a unifying construct that implies </p>
  
  <pre><code>file1 = sys.stdin
  </code></pre>
  
  <p>and </p>
  
  <pre><code>file1 = fileinput.input(sys.argv[1])
  </code></pre>