title: In Python, allowing subsequent code to be executed after Tkinter dialog is shown
body: <p>I am using Tkinter in Python to display an dialog box. After the dialog box is shown, subsequent code should execute regardless whether user has closed the dialog box or not. </p>
  
  <p>I tried to use thread to create the dialog box in a new thread, but it doesn't seem to work. I suppose I would need to encapsulate the subsequent code in a separate thread which I do not wish to.</p>
  
  <pre><code>def alert(title, message):
      box = Tk()
      box.title(title)
      Message(box, text=message, bg='red',
        fg='ivory').pack(padx=1, pady=1) #, relief=GROOVE
      Button(box, text="Close", command=box.destroy).pack(side=BOTTOM)
      box.geometry('300x150')
      thread.start_new_thread(box.mainloop())
      hello()
  
  def hello():
      print 'hello!'
  </code></pre>
  
  <p>The issue with the code above is that 'hello!' will only be printed after user has dismissed the alert box. How can I modify my code to have hello() (or any subsequent code for that matter) to be executed regardless of the status of the dialog box?</p>