import tkinter as tk window = tk.Tk() entry = tk.Entry() entry.grid(row=0,column=0,columnspan=3) l1 = tk.Label(text="10%", width=3) l1.grid(row=1, column=0) l2 = tk.Label(text=16500, width=7) l2.grid(row=1, column=1) window.mainloop()
import tkinter as tk window = tk.Tk() entry = tk.Entry() entry.grid(row=0,column=0,columnspan=3) l1 = tk.Label(text="10%", width=3) l1.grid(row=1, column=0) l2 = tk.Label(text=16500, width=7) l2.grid(row=1, column=1) window.mainloop()
import tkinter as tk window = tk.Tk() entry_var = tk.StringVar() entry_var.trace('w', lambda name, index, mode :(l2.config(text=int(entry_var.get())*1.2))) entry = tk.Entry(textvariable=entry_var) entry.grid(row=0,column=0,columnspan=3, ) l1 = tk.Label(text="10%", width=3) l1.grid(row=1, column=0) l2 = tk.Label(text=16500, width=7) l2.grid(row=1, column=1) window.mainloop()