Python Source Code

Make a Clock using Python | Python Project(Source Code)

Using python, we can create so many interesting things. Yes, python is soo easy. And if you are a new python programmer & want to be good in it. Then start creating python projects now. Because building projects is fun & interesting.

In this python project, we will create a clock using python. Python has a huge number of libraries. And Tkinter is one of them. Tkinter helps us to create GUI interfaces easily. That’s why, we will build a simple digital clock using python Thinter.

Python 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", s0), background = "black" foreground = "cyan")
label.pack(anchor='center')

time ()
mainloop()

More Queries: