title: Python, count down timer that doesn't sleep
body: <p>I am new to python and i am trying to make a countdown timer on a button click. But i would like this countdown timer to start its countdown and place the current countdown value in the text area. Also i need the rest of the application to not sleep while this countdown is running. So far it will output the countdown in the console but will freeze the rest of the application. Can someone point me in the right direction?</p>
  
  <pre><code>from Tkinter import *
  import time
  import threading
  import thread
  
  class App:
  
  
      def __init__(self, master):
  
          frame = Frame(master)
          frame.pack()
  
          self.getvalue = Button(frame, text="Get the Text Area", command=self.thevalue)
          self.getvalue.pack(side=LEFT)
  
          self.text_area = Entry()
          self.text_area.pack(side=RIGHT)
  
  
      def thevalue(self):
          print "In the value"
          try:
              t = threading.Thread(target=self.print_time("I am in print_time"))
              t.daemon = True
              t.start()
          except:
              print "Error: unable to start thread"
  
      def print_time(self,bleh):
          print bleh
          print "The text area value is %s" % self.text_area.get()
          boom=5
          while boom &gt;0:
              time.sleep(1)
              self.text_area.delete(0, END)
              self.text_area.insert(0, boom)
              print(boom)
              boom -=1
  
  root = Tk()
  
  app = App(root)
  
  root.mainloop()
  </code></pre>