title: How can I open a main window after closing the current login in Tkinter?
body: <p>I did a little quick login and I was wondering how to close this login window when pressing the button and verify that the data is in the database. After closing it, open the main window.</p>
  <p>Here is the code of the button command:</p>
  <pre><code>def sendLoginButtonAct():
  
      con=sqlite3.connect(&quot;cashier.db&quot;)
      cur=con.cursor()
  
      try:
          cur.execute('''
              CREATE TABLE USERS (
                  USERNAME VARCHAR(25) UNIQUE,
                  PASSWORD VARCHAR(25),
                  CASH INTEGER
              )
          ''')
      except:
          pass
  
      cur.execute(&quot;SELECT * FROM USERS WHERE USERNAME=? AND PASSWORD=?&quot;, (userEntry.get(), passEntry.get()))
  
      
  
      if cur.fetchall() == []:
          messagebox.showerror(&quot;Error&quot;, &quot;Incorrect username or password.&quot;) 
  
      else:
          # Here i want to create the main window and close the login
  </code></pre>