Import tkinter
windows = tkinter。 Tk()? # Instantiate the window class
Windows.title ('demo')? # Window title
Def sub(): # Create an addition function
number 1 = int(ent 1 . get())? # Convert the contents of two buttons to string type.
number2 = int(ent2.get())
Number 3 = number 1+number 2
Variable set (number 3)
var = tkinter。 IntVar()? # Define variable types
ent 1 = tkinter。 Getting started (windows)?
ent2 = tkinter。 Entries (windows)
ent3 = tkinter。 Entry (windows, textvariable=var)
ent 1.pack(side = tkinter。 Left, padx=5)? # Line break positioning control
ent2.pack(side = tkinter。 Left, padx=5)
ent3.pack(side = tkinter。 Left, padx=5)
button 1 = tkinter . button(Windows,text =' calculation ',command = sub)。 pack()? # Binding signal
Button 2 = tkinter.button (Windows,text =' exit ',command = windows.destroy)。 Pack ().
windows.mainloop()? # Loop to keep the window running