Nov-27-2022, 05:00 PM
(Nov-24-2022, 07:22 PM)wuf Wrote: It works also like this:I tried running the code.
import tkinter as tk import time def get_time(canvas): show = time.strftime(f'%I:%M:%S %P') canvas.itemconfig(var, text=show) canvas.after(1000, get_time, canvas) root = tk.Tk() canvas = tk.Canvas(root, width=600, height=500, bg='antiquewhite') show = time.strftime(f'%I:%M:%S %P') var = canvas.create_text(300,100, text=show, fill='blue', font=('serif', 20, 'bold')) canvas.pack() get_time(canvas) root.mainloop()Greetings wuf
Error:Traceback (most recent call last):
File "C:\Users\Wannes\canvas update.py", line 13, in <module>
show = time.strftime(f'%I:%M:%S %P')
ValueError: Invalid format string
The only stupid person in the world, is the person that doesn't ask questions.
-Someone smart
-Someone smart