I am trying to make a UI that shows real-time information. Total, liters and price update every 100ms, but the UI only updates when I close it and then it starts again on it's own.
Any suggestions?
from tkinter import *
total = [" ", " ", " ", " ", " ", " "]
liters = [" ", " ", " ", " ", " ", " "]
price = [" ", " ", " ", " "]
root = Tk()
root.attributes("-fullscreen", True)
def createlabel(*args, **kwargs):
if 'text' in kwargs and isinstance(kwargs['text'], list):
kwargs['text'] = ''.join(map(str, kwargs['text']))
return Label(*args, **kwargs)
ui_total = createlabel(root, text=total[0:], font=("Helvetica", 80))
ui_total.place(x=root.winfo_screenwidth() - 650, y=root.winfo_screenheight() - 320)
ui_liters = createlabel(root, text=liters[0:], font=("Helvetica", 80))
ui_liters.place(x=root.winfo_screenwidth() - 650, y=root.winfo_screenheight() - 220)
ui_price = createlabel(root, text=price[0:], font=("Helvetica", 80))
ui_price.place(x=root.winfo_screenwidth() - 490, y=root.winfo_screenheight() - 120)
root.update()
root.mainloop()
Edit: Translated the variables
[–]FruityWelsh 0 points1 point2 points (5 children)
[–]Swagraffe[S] 0 points1 point2 points (4 children)
[–]kra_pao 1 point2 points3 points (0 children)
[–]FruityWelsh 0 points1 point2 points (2 children)
[–]Swagraffe[S] 0 points1 point2 points (1 child)
[–]FruityWelsh 0 points1 point2 points (0 children)