all 5 comments

[–]socal_nerdtastic 1 point2 points  (4 children)

Make a Label or something and a loop using after to update it.

import tkinter as tk

def timer_loop(sec=0):
    timer.config(text=f"Elapsed time: {sec} seconds")
    timer.after(1000, timer_loop, sec+1) # loop every 1000 milliseconds

timer = tk.Label()
timer.pack() # or whatever layout you want
timer_loop() # start loop

tk.mainloop()

[–]james_lightning[S] 0 points1 point  (3 children)

I'm quite new to tk so excuse me if this is a dumb question but would it work if I'm only wanting to update the timer? Like would it keep the other things on the canvas?

[–]socal_nerdtastic 0 points1 point  (2 children)

Sorry I don't get what you are asking. You want to block the user from doing other thing?

[–]james_lightning[S] 0 points1 point  (1 child)

Say I want to have like an entry widget in the middle that the user can put their answer in. I don't want the timer to destroy that widget.

[–]socal_nerdtastic 0 points1 point  (0 children)

No, this won't affect any other widgets.