I am new to tkinter. I want to write two numbers in two different entries in GUI and see their updated subtraction result on the display. here is my code:
from tkinter import *
window = Tk()
lb1 = Label(window,text="variable 1")
lb1.pack()
name1=IntVar()
en1=Entry(window, textvariable=name1)
en1.pack()
lb2 = Label(window,text="variable 2")
lb2.pack()
name2=IntVar()
en2=Entry(window, textvariable=name2)
en2.pack()
subt=IntVar()
subt=name1.get()-name2.get()
label_subt=Label(window, text=subt).pack()
how can I update label_subt
?