0% found this document useful (0 votes)
58 views

Digital Clock Full

The document describes how to create a digital clock using Tkinter in Python. It imports necessary modules like tkinter and time, creates a window and labels, and uses a function to continuously display the current system time on the label by calling it repeatedly with a delay.

Uploaded by

Sadab Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Digital Clock Full

The document describes how to create a digital clock using Tkinter in Python. It imports necessary modules like tkinter and time, creates a window and labels, and uses a function to continuously display the current system time on the label by calling it repeatedly with a delay.

Uploaded by

Sadab Hussain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DESCRIPTION

1. The code starts by importing the necessary modules.


2. The first module is the tkinter library, which provides basic
functionality for creating graphical user interfaces (GUIs).
3. Next, the strftime function is imported to retrieve system time.
4. Next, a window is created and given a title of “Clock.”
5. A function called time() is then created to display the current time on
the label widget.
6. This function uses the strftime() function to format the time string
according to system conventions.
7. The last part of this code sets up styling for the label widget so that it
will look nicer.
8. Finally, an instance of Label is created and placed at the center of the
window.
9. The time() function is executed, and your output should look like this:
Clock: Tue Dec 12 08:00:00 2016
10. The code creates a window and assigns it the title “Clock”.
11. The time() function is then called to display the current time on the
label widget.
12. The lbl.config() function is used to set the text of the label widget.
13. The after() function is used to delay displaying the time for 1000
milliseconds.
14. Finally, the style of the label widget is modified with lbl.pack().
INRODUCTION

Create a digital clock using Tkinter


As we know Tkinter is used to create a variety of GUI (Graphical User
Interface) application. In this article we will learn how to create a digital
clock using Tkinter.

Prerequisites:
Python functions
Tkinter basics (Label Widget)
Time module

Using Label Widget From Tkinter And Time Module:


In the following application, we are going to use Label widget and also
going to use time module which we will use retrieve system’s time.
BIBLIOGRAPHY

Help from internet and following websites links, have been used in
the completion of this project file.

* https://www.google.com/
* https://www.kaggle.com/
* https://cbseacademic.nic.in/web_material/
* https://aiforkids.in/class-10/

Books used:-

* Head first python


* Python programming for Beginners

You might also like