from tkinter import * from functools import partial def raise_frame(frame): frame.tkraise() win = Tk() win.geometry("400x300+10+10") win.title("Calculator") third_frame = Frame(win) third_frame.place(x=0, y=0, width=400, height=300) second_frame = Frame(win) second_frame.place(x=0, y=0, width=400, height=300) first_frame = Frame(win) first_frame.place(x=0, y=0, width=400, height=300) label_0 = Label(first_frame, text="CHOOSE NUMBER OF INPUT",width=30,font=("bold", 12)) label_0.place(x=60,y=50) Button(first_frame, text='2 inputs',width=10,font=("bold", 10),bg='yellow',fg='black', command=lambda:raise_frame(second_frame)).place(x=155,y=150) Button(second_frame, text="Back to Front Page",width=18,bg='brown',fg='white', command=lambda:raise_frame(first_frame)).place(x=20,y=260) label_1 = Label(second_frame, text="Digit 1",width=10,font=("bold", 10)) label_1.place(x=100, y=50) entry_1 = Entry(second_frame) entry_1.place(x=200,y=50) label_2 = Label(second_frame, text="Digit 2",width=10,font=("bold", 10)) label_2.place(x=100,y=100) #RT = get()(second_frame, entry1, entry2.get()) entry_2 = Entry(second_frame) entry_2.place(x=200,y=100) label_3 = Label(second_frame, text="Result",font=("bold", 10)) label_3.place(x=100,y=200) entry_3 = Entry(second_frame) entry_3.place(x=200,y=200) #RT = (entry_1,get() + entry_2,get()) #entry_3.second_frame, insert(END, str(RT)) Button(second_frame, text='ADD',width=10,bg='blue',fg='black').place(x=100,y=150) #second_frame.entry1, R1 = int(get()) #entry_2.delete(0,END) #R1=int(entry_1.get()) #R2=int(entry_2.get()) #RT= R1 + R2 #entry_3.insert(END, str(RT)) Button(second_frame, text='SUB',width=10,bg='blue',fg='black').place(x=200,y=150) win.mainloop()
Larz60+ write Oct-23-2020, 03:09 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time.