Help with this part of code
""" want to go to a new window if the password is correct but don't know how, if I put # lambda: controller.show_frame(pageone)) inside the button, it will go without checking the password" class StartPage(tk.frame): def loginusr (self): name = self.usrname_entry.get() pw = self.password_entry.get() def cross-check(): sql = ('SELECT password FROM kng WHERE Name = %s',(name)) af = a.execute(*sql) data = a.fetchone() return data[0] try: p = cross-check() except TypeError: tkinter.messagebox.showinfo("loginpg","error") if pw == p: tkinter.messagebox.showinfo("loginpg","login successful") else: tkinter.messagebox.showwarning("loginpg","Username or password is incorrect") #button Self.loginbutton = tk.Button(self, active background="#ececec"...command =self.loginUser) self.loginbutton.place(relx= ...)