from tkinter import * def p(): a =int(e1.get()) b =int(e2.get()) c=a+b t.configure(text =str(c)) window=Tk() window.title("Сума") e1 = Entry(window, width=10) e2 = Entry(window, width=10) b = Button(text="+",width=10,command=p) t = Label(window, width=10,text="") e1.grid(column=0, row=0) e2.grid(column=0, row=1) b.grid(column=0, row=2) t.grid(column=0, row=3) window.mainloop()