Digital Clock in Python using Tkinter

Source Code:

import time
from tkinter import *

root = Tk()
root.title("Digital Clock")
root.resizable()
lbl = Label(root)
lbl.grid(row=0, column=0)


def display():
    time_get = time.strftime("%Y/%m/%d\n%I:%M:%S %p")
    lbl.config(text=time_get, bg='blue', fg='white',
               font=('Times New Roman', 50, 'bold'))
    lbl.after(100, display)


display()
root.mainloop()

 

Output:

digital clock

By cbsepython

A complete solution for the students of class 9 to 12 having subject Information Technology (402), Computer Science (083). Explore our website for all the useful content as Topic wise notes, Solved QNA, MCQs, Projects and Quiz related to the latest syllabus.

Copywrite © 2020-2024, CBSE Python,
All Rights Reserved