i found a tutorial on google which integer value could be update by using .config(). So I had using the below code to update the value. I think my logic it wrong by put the while loop like that , but i not sure how could i update the a = a + 1 on to the gui.
My code :
import tkinter as tk
from random import randint
master_window = tk.Tk()
master_window.geometry("250x150")
master_window.title("IntVar Example")
lab = tk.Label(master_window)
integer_variable = tk.IntVar()
integer_variable.set(2)
label = tk.Label(master_window,text="output", height=50)
label.place(x=80, y=80)
a = 25
def update():
my_data=integer_variable.get(a) # read the value of selected radio button
label.config(text=str(my_data)) # Update the Label with data
while True:
a = a + 1
master_window.update()
master_window.mainloop()
