I did not try anything because I did not know what to do that way.
My way of manipulating windows is that way in login file:
def verificaSenha(self): with sqlite3.connect("banco.db") as db: cursor = db.cursor() find_user = ('SELECT * FROM users WHERE user = ? AND senha = ?') cursor.execute(find_user,[(self.user.get()),(self.senha.get())]) results = cursor.fetchall() if results: self.mensagem["text"] = "Logado" self.wind.destroy() from user import Users janela2 = Tk() Users(janela2) else: self.mensagem["text"] = "Login incorreto!"
In user file:
def logout(self): from app import loginUser self.wind.destroy() janela = Tk() loginUser(janela)
I hope you can help me, please. Because I do not get any error.