I have script like this
if int(isValidUser)==1:
UserNameTB.place_forget()
PasswordTB.place_forget()
import MainPage
else:
tk.messagebox.showinfo(message="wrong account")
I have window called mainForm so when I run this code it opens windows where are LogIn form. so for example someone Loged in correctly it imports MainPage (mainPage is account window)
the mainPage script is like this:
import LogInPage
import tkinter as tk
menubar=tk.Menu(mainForm)
menubar.add_command(label="Customer",command=ShowCustomerWidgets)
menubar.add_command(label="Operator",command=ShowOperatorWidgets)
menubar.add_command(label="Admin")
mainForm.config(menu=menubar)
So when It runs this script it creates another Window where is still LogIn form and also mainPage widgets, how could I stop this, so for example when user Logs in the window stayed the same but different widgets came up and old ones disappear.
P.S I can't put the whole code in One .py file