title: python thread only prints to stdout after join
body: <p>I have a python program which I am trying to add a progress bar to.  My thread class is:</p>
  
  <pre><code>class ProgressThread(threading.Thread):
      def __init__(self):
          super(ProgressThread, self).__init__()
          self.stoprequest = threading.Event()
  
      def run(self):
          while not self.stoprequest.is_set():
              print ".",
              time.sleep(5)
  
      def join(self, timeout=None):
          self.stoprequest.set()
          super(ProgressThread, self).join(timeout)
  </code></pre>
  
  <p>Then in my main thread I am using the thread class above like this:</p>
  
  <pre><code>progress_thread = ProgressThread()
  progress_thread.start()
  ret = long_running_method()
  progress_thread.join()
  </code></pre>
  
  <p>The issue I am having is that the dots do not get printed until I call join().  The correct number of dots are there corresponding to the time it takes for long_running_method to complete but I want them to show up one by one just to show the user that the program is not hung.</p>