I'm trying to make a GUI using tkinter which has a refreshing display. I have this code,
while True:
val= randint(1,50)
And this is the loop for my GUI,
label2= Label(root, text= val , font=("Helvetica", 60))
label2.place(relx=0.53, rely=0.44, anchor=CENTER)
root.mainloop()
These two do not seem to work simultaneously. The one placed above the other one executes first which is an infinite loop so it never reaches "root.mainloop()". I want to update the label content constantly. How do I do it?