Create a digital clock using Python

Create a digital clock using Python

The full source code is available here

Jan 24, 2023Β·

1 min read

Play this article

Hi programmers,

In this blog, I will share a complete source code for a python Tkinter GUI clock. So Let's get started to code.

from tkinter import from tkinter.ttk import

from time import strftime

root = Tk() root.title("Clock")

def time(): string = strftime('%H:%M:%S %p') label.config(text=string) label.after(1000, time)

label = Label(root, font=("ds-digital", 80), background="black", foreground="cyan") label.pack(anchor='center') time()


Output :

It would be greatly appreciated if you would give me a like πŸ’“ and if you found this blog to be informative, please follow me and share it with your friends who are interested in learning how to code.

Join my page and support me: click here

Use This link to get 37% off: link

Thank you so much :)