Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Set of timer (stopwatch & countdown) widgets for tkinter

Project description


tktimer is a set of tkinter widgets which includes a Stopwatch widget and a Countdown widget.

installing tktimer

tktimer is available on PyPI:

$ pip install tktimer

using tktimer

Timers have two methods: start and pause.

Here is an example program:

import tkinter as tk

from tktimer import Countdown

root = tk.Tk()
timer = Countdown(root)
timer.grid(row=0, column=0, columnspan=2, sticky="nswe")
tk.Button(root, text="Start", command=timer.start).grid(row=1, column=0)
tk.Button(root, text="Pause", command=timer.pause).grid(row=1, column=1)

Available options:

option description default
parent set the parent widget
prefix set text before timer value ""
suffix set text after timer value. ""
unit set the unit (available: seconds, minutes, hours, days, weeks, years) seconds
beginning set starting point (in seconds). specific to Countdown. 10
update_every set updating time every X milliseconds. 10
precision set counting precision (number of digits after the decimal point). 2
time_elapsed set time elapsed (in seconds). specific to Stopwatch. 10


How can I continue the timer after restarting my app?

You can get the elapsed time (in seconds) with timer.value.get() on exit and set time_elapsed later on, which will make the timer start counting from time_elapsed. For Countdown, tweak beginning instead of time_elapsed.

I'm not happy with how my timer looks like. Can I change its appearance?

Yes, timers are ultimately just tkinter labels, which means you can do anything you would to an ordinary tkinter.Label. For example, to change the font, you can do:

timer.label.configure(font="Helvetica 18 bold")

Project details

Release history Release notifications

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for tktimer, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size tktimer-0.0.1-py3-none-any.whl (7.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size tktimer-0.0.1.tar.gz (10.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page