I am working on a GUI to display the value from a device. I am able to extract the data from the device but it only happen in single cycle.
I tried the trace() function but it doesn't work. How can i continuously read if the value is being change, and the widget will change automatically.
my code:
def on_variable_trace(*args):
if entryVariable2.get() == "":
entryWidget3.configure(state="disable")
else:
entryWidget3.configure(state="normal")
D_lbl=Label(window, text="D 2001", fg='red', font=("Helvetica", 16))
D_lbl.place(x=200, y=250,anchor=CENTER)
result_d = IntVar(window,read_D_memory())
D_lbl_r=Label(window, textvariable=result_d, fg='red', font=("Helvetica", 16))
D_lbl_r.place(x=350, y=250,anchor=CENTER)
result_d.trace("w", on_variable_trace)
the value result_d
(as shown 301) shall change after i manually change the value from the device