title: ipython notebook is NOT printing until the whole program is finished
body: <pre><code>import time
  
  print 1
  time.sleep(5)
  </code></pre>
  
  <p>I ran the code above in IPython notebook and normal script separately.</p>
  
  <p>In <code>IPython Notebook</code>, it doesn't print the number '1' until <code>time.sleep(5)</code> is finished, while in normal script it DOES print out number '1' first and go into <code>time.sleep(5)</code>. What would that happen? </p>
  
  <p>This example is just to illustrate my problem: I use <code>print</code> to print out some text at every stage in my code, which takes a long time to finish, so that I can know where the programme has got to. I found this works fine when executing the script, but in <code>IPython Notebook</code> <code>print</code> often lags behind and everything is printed out when the whole program is finished.</p>
  
  <p>Is there any way to solve this in <code>IPython Notebook</code>?</p>