Python, count down timer that doesn't sleep
Question: 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?

    
    
    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 >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()
    


Answer: 
    threading.Thread(target=self.print_time("I am in print_time"))
    

This will not do what you want it to do. What happens here is that the
function `self.print_time` is called and its return value is then passed to
the constructor of `threading.Thread`.

You need to create the thread like this:

    
    
    t = threading.Thread(target=self.print_time, args=("I am in print_time",))
    

