Digital Clock
Using Python
By : Uday Sharma
ID : BC2024045
Submitted To : Mr.
Nishant Thakur
Slide 2:
Introduction
Digital Clock project is a simple
Python-based application that
displays the current time on a GUI
window. It refreshes every second to
keep the displayed time accurate.
This project combines basic
programming logic with visual
output using Python’s tkinter library.
By building this project, students
can learn how to handle real-time
updates and design user-friendly
interfaces.
Slide 3:
Objective of the Project
The main objective of this project is to
design a desktop application that acts as
a digital clock. It should automatically
update the current time every second
and display it in an easy-to-read format.
The focus is on Real-time functionality
Clean and responsive GUI Learning how
to use Python’s built-in libraries
effectively Gaining hands-on experience
with event-based programming
Slide 4:
Tools and Technologies Used
Programming Language: Python 3Modules:tkinter: for GUI creation
time: to fetch and format system time Platform: Works on Windows,
Linux, or macOS This project is completely platform-independent and
runs on any system with Python installed. No third-party libraries are
required, making it simple and accessible for all students.
Libraries :
Tkinter – for GUI
Time – for real clock
Slide 5:
How It Works (Logic)
Use time.strftime() to get system
time
Create a GUI window using tkinter
Display the time in a label
Refresh the time every second using
after(1000) function The loop keeps
updating the time, giving a real-time
effect.
Slide 6:
Code – Import & Setup
from tkinter import *
import time
root = Tk()
root.title("Digital Clock")
root.geometry("350x150")
root.configure(bg='black’)
These lines import required libraries and create the clock window with
title, size, and black background.
Slide 7:
Code – Time Update Function
def update time():
current time = time.strftime('%H:%M:%S’)
label.config(text=current time)
label.after(1000, update time)
This function gets the current time and updates it every second
using after().
Slide 8:
Code – Display & Runlabel
label = Label(root, font=('Arial', 40), fg='lime', bg='black’)
Label.pack(anchor='center’)
Update time()
root.mainloop()
The time is shown in a label with large green font on a black
background. mainloop() runs the GUI.
Slide 9:
Features
Displays time in real-time
Auto-refreshes every second
Minimal and clean user
interface
Uses only standard libraries
Works smoothly on all
platforms
Slide 10:
Limitations
Does not show date
No alarm or timer feature
Cannot switch between 12/24-hour format Still, for a mini
project, it fulfills its purpose perfectly.
Slide 11:
Future Improvements
Add alarm or reminder feature
Show date and day
Add themes (dark/light)
Support for different time zones
These updates can make the project more useful.
Slide 12: