title: Automatically close window after a certain time
body: <p>In a class, in a function I am creating a Tkinter Canvas. This function is being called by another class, I would like for the Tkinter window to pop up for 30 seconds and then close itself. I have it call </p>
  
  <pre><code>master.mainloop()
  time.sleep(30)
  master.destroy() 
  </code></pre>
  
  <p>But I get an error </p>
  
  <blockquote>
    <p>"elf.tk.call('destroy', self._w)
    _tkinter.TclError: can't invoke "destroy" command:  application has been destroyed" </p>
  </blockquote>
  
  <p>So how can I have it close itself?</p>