title: Python output on file and terminal
body: <p>There are times when I want my program to write something on the terminal for immediate inspection and on a file for later use, so I write something like:</p>
  
  <pre><code>print "output"
  file.write("output")   #the same output as the previous line
  </code></pre>
  
  <p>Is it possible, with python 2.6 or 7, to do it in another, maybe smarter, way?</p>