I want to have a two page GUI. Page one will have the day-2-day content and page 2 will be all the setup variables. My code creates two pages and defaults to Page 1. When I click on the Page 2 button, the page 2 data is shown, but the Page 1 data doesn't go away. After that, no matter which button is selected, content for both pages is displayed. I want only one page content to be displayed at a time with the ability to change pages as required.
import tkinter as tk
from tkinter import *
from tkinter import ttk
root=tk.Tk()
root.geometry("1000x500")
root.title ('Multi-Page GUI')
frame=tk.Frame(root,bg='lightblue')
frame.place(relx=0.1,rely=0.1,relheight=0.85,relwidth=0.85)
def page1():
bt1.lower(frame)
bt.lift(frame)
labelpage1 = Label(root,text ="Page One", bg='lightblue', font=("Arial",12)).place(x=100,y=100)
def page2():
bt.lower(frame)
bt1.lift(frame)
labelpage1 = Label(root,text ="Page Two", bg='lightblue', font=("Arial",12)).place(x=100,y=200)
bt=tk.Button(root,text='Page 1',command=page1)
bt.grid(column=0,row=0)
bt1=tk.Button(root,text='Page 2',command=page2)
bt1.grid(row=0,column=1)
command = page1()
root.mainloop()