Feb-17-2020, 10:48 PM
How do I get this to count in the label? It just shows an empty window and gives me an error when I close it.
import time import tkinter as tk def sequence(): root = tk.Tk() label = tk.Label(root) label.pack() root.mainloop() t = 0 msg = f"{t}" while True: label(root, text=msg) t += 1 time.sleep(3) if __name__ == "__main__": sequence()
Error:Traceback (most recent call last):
File "c:/Users/User/MyStuff/git/Python-doodles/utilities/Temperature_venv/tk_tst.py", line 22, in <module>
sequence()
File "c:/Users/User/MyStuff/git/Python-doodles/utilities/Temperature_venv/tk_tst.py", line 15, in sequence
label(root, text=msg)
TypeError: 'Label' object is not callable