title: Interacting with Tkinter window during a long process
body: <p>I have a basic python class that creates a window using the standard <code>Tkinter</code> library:</p>
  
  <pre><code>import Tkinter
  
  class GUI(Tkinter.Tk):
  
      def __init__(self,parent):
          Tkinter.Tk.__init__(self,parent)
          self.parent = parent
          self.initialize()
  
      def lock_func(self):
          while 1==1:
              print "blah"
  
      def initialize(self):
          self.processBtn = Tkinter.Button(self, text="Process", command=self.lock_func)
          self.processBtn.pack()        
  
  app = GUI(None)
  app.mainloop()
  </code></pre>
  
  <p>when I hit the <code>Process</code> button, the window doesn't respond.
  I want to be able to close the program (using the x button) whene the <code>lock_func</code> is runing.</p>