def start_timer():
for mins in range(WORK_MIN - 1, 0, -1):
for secs in range(59, 0, -1):
print(mins, secs)
timer.itemconfig(timer_text, text=(f"{mins}:{secs}"))
time.sleep(1)
I call this function with a button click which is supposed to start a countdown timer and update the Canvas (timer = Canvas()
) text every second. If I comment out the time.sleep(1)
command the displayed text seems to change as it ends at 1:1. However, with the time.sleep(1)
command active, then the Canvas text never updates. I added The print(mins, secs)
to verify that the loops were executing properly.
Question: anyone see anything that would prevent the timer.itemconfig
from working properly with the time.sleep
statement?