Countdown timer

Display countdown in seconds in a Label.
Countdown value showing in Label

Tkinter window to show count down value in a Label by starting from a fixed value
import tkinter  as tk 
my_w = tk.Tk()
my_w.geometry("350x170")  # width and height of the window

counter=11 # Initital value of counter
def my_time():
    global counter
    counter=counter-1 # decrease value by 1 
    if counter < 0:
    l1.config(text=str(counter)) # Update the label text using string
    l1.after(1000,my_time) # time delay of 1000 milliseconds 
my_font=('times',76,'bold') # display size and style

my_time() # call the function 

Adding Reset button

Countdown with Reset button

To start the counter again from any value , we can add one reset button. Place this code above the line my_w.mainloop()
def restart():
    global counter
    counter=11 # start value 
    my_time() # call the function 
Analog Clock in Tkinter Canvas

Projects in Tkinter Displaying Calendar to pick date
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2023 All rights reserved worldwide Privacy Policy Disclaimer