title: Using tee to get realtime print statements from python
body: <p>I have a python script that looks something like this:</p>
  
  <pre><code>for item in collection:
      print "what up"
      #do complicated stuff that takes a long time.
  </code></pre>
  
  <p>In bash, I run this script by doing the following:</p>
  
  <pre><code>$ python my.py | tee my_file.txt
  </code></pre>
  
  <p>However, all I see in bash is a blank line until the program finishes. Then, all of the print statements come all at one.</p>
  
  <p>Is this the expected operation of tee? Can I use tee to see the output in real-time?</p>