Create a digital clock using Python

G.NiruthianG.Niruthian
1 min read

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()

mainloop()

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 nas.io page and support me: click here

Use This link to get 37% off: link

Thank you so much :)

#CrazyBlogger

2
Subscribe to my newsletter

Read articles from G.Niruthian directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

G.Niruthian
G.Niruthian