title: Buffered versus unbuffered output for Python in Windows
body: <p>I use NppExec/Notepad++ to run Python scripts, and flush my output buffers continuously during runtime to update my console window with <code>print</code> statements (The default buffered output only shows <em>all</em> print statements after the script finishes execution). </p>
  
  <p><a href="https://superuser.com/questions/381942/stop-nppexec-from-trapping-console-output-until-program-finishes">This</a> link shows that all you need to do is use the command <code>python -u</code> to get unbuffered output. Is there a downside to using this execution mode for <strong>all</strong> my Python scripts, <em>regardless of the editor used</em>? I'm not clear about the difference between a buffered an unbuffered output. </p>
  
  <p><strong>EDIT</strong>: I included this small Python timer script for an example:</p>
  
  <pre><code>#!usr/bin/env python
  import time
  import threading
  import sys
  
  class Timer(threading.Thread):
      def __init__(self, seconds):
          self.runTime = seconds
          threading.Thread.__init__(self)
      def run(self):
          counter = self.runTime
          for sec in range(self.runTime):
              print counter
              time.sleep(1.0)
              counter -= 1
          print "Done."
  
  if __name__ == '__main__':
      t = Timer(10)
      t.start()
  </code></pre>
  
  <p>How much difference does a buffered and unbuffered output make in terms of efficiency in this case?</p>