title: Close existing toplevel when a new is created. Tkinter Python 3
body: <p>Ive got a button in a program that opens a toplevel window.
  If the button is pressed again I want the old toplevel to be destroyed and a new one to be created. I've searched for hours and tried implementing different ways but nothing seems to work. </p>
  
  <p>Ive tried these approaches in various forms:</p>
  
  <pre><code>if toplevel is None or not toplevel.winfo_exists():
      toplevel.destroy()
  
  
  try:
      toplevel.destroy()
  except:
      pass
  
  
  if toplevel.winfo_exists() == "1":
      toplevel.destroy()
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>def translate():
          #(I would like to check for and close existing toplevels here)
          toplevel = Toplevel()
          ...stuff
  </code></pre>
  
  <p>I greatly appreciate all the help I can get!</p>