This is a really easy and simple Python Project to create a digital clock. On doing this, we can efficiently implement Python Programming Language via this digital clock creation.
A digital clock is basically a clock that displays the time in a numeral format. In other words, we can display time using numbers with the help of this digital clock. Our world runs on numbers mainly and that is one of the primary reasons in the invention of digital clocks.
In this Python Project we first open any Python language console and then make use of the main package for this digital - clock - " tkinter ". We then write the code necessary forthe displaying of digital clock.
In the code, we mainly focus on the configuration of our digital clock like, the font, the background color, the foreground color, the format of time the clock displays etc.
Now for the digital font display, we have to download the font in case we don't have it already. The downloads are provided in the zip folder. They come under the damily of " DS - DIGITAL ", we should include this font in the labelling of our digial clock configuration.
The color of the digital display is totally according to the preference of the individual.
In this way we write the Python Code and run the file to get the desired output - THE DIGITAL CLOCK in our case.
from tkinter import *
from tkinter.ttk import *
from time import strftime
c = Tk()
String = strftime('%H:%M:%S %p')
l.config(text = String)
l = Label(c, font = ("ds-digital", 100), background = "black", foreground = "#e48af2")
l.pack(anchor = 'center')
Submitted by RAMYA RAJESWARI VISSAPRAGADA (ramyavissapragada)
Download packets of source code on Coders Packet