title: Make ipython notebook print in real time
body: <p>Ipython Notebook doesn't seem to print results in real time, but seems to buffer in a certain way and then bulk output the prints. How can I make ipython print my results as soon as the print command is processed?</p>
  
  <p><strong>Example code:</strong></p>
  
  <pre><code>import time
  
  
  def printer():
      for i in range(100):
          time.sleep(5)
          print i
  </code></pre>
  
  <p>Supposing that the above code is in a file that is imported. How could I make it that when I call the printer function it prints a number every 5 seconds and not all the numbers at the very end?</p>
  
  <p>Please note that I cannot edit the function <code>printer()</code> because I get it from some external module. I want the to change the configs of ipython notebook somehow so that it doesn't use a buffer. Therefore, I also do not wish to use sys.stdout.flush(), I want to do it in real-time according to the question, I don't want any buffer to start with.</p>
  
  <p>I also tried loading ipython notebook with the command:</p>
  
  <pre><code>ipython notebook --cache-size=0
  </code></pre>
  
  <p>but that also doesn't seem to work.</p>