The problem is this: when I check the box opposite, say, Volume and click the Submit button, in the output I get zero, but I would like to be edinichku. Maybe you say that I need to work with classes, but ... maybe you can somehow do without them?)

from tkinter import * def bInput(event): def retrieve_input(): Radius=rText.get("1.0",END) print(Radius) Height=hText.get("1.0",END) print(Height) Density=dText.get("1.0",END) print(Density) print(var1.get(), var2.get()) root = Tk() root.title("Circle") root.geometry("300x250") WarningM = Label(root, text='Please, enter NUMBERS, not letters and symbols!').pack() RadiusL = Label(root, text='Radius:').pack() rText = Text(root, height=1, width=10) rText.pack() HeightL = Label(root, text='Height:').pack() hText = Text(root, height=1, width=10) hText.pack() DensityL = Label(root, text='Density:').pack() dText = Text(root, height=1, width=10) dText.pack() var1 = IntVar() Checkbutton(root, text='Volume', variable=var1).pack() var2 = IntVar() Checkbutton(root, text='Mass', variable=var2).pack() Button(root, text='Submit', command=lambda: retrieve_input()).pack() def bWork(event): root = Tk() root.title("Results") root.geometry("200x200") def bExit(event): exit() root = Tk() root.title("%yna kakaya-ta") root.geometry("300x150") b_input = Button(root, text="Input", width = 10, height=2) b_input.bind("<Button-1>", bInput) b_input.pack() b_work = Button(root, text="Work", width = 10, height=2) b_work.bind("<Button-1>", bWork) b_work.pack() b_exit = Button(root, text="Exit", width = 10, height=2) b_exit.bind("<Button-1>", bExit) b_exit.pack() root.mainloop() 

    1 answer 1

    Question with a similar problem: The IntVar () field in the class is not changed.

    The problem is that you create child windows through Tk() , but you need to through Toplevel() .

    Just changed in bInput Tk to Toplevel :

    Screenshot