How to Create a Digital clock using Python Programming language | Python Tkinter GUI | Code Hub

MNC Answers
0

In this post we will learn about How to How to Create a Digital clock using python programming language. In this program we using "tkinter " package.


Tkinter package:

    In this Tkinter package used to create a simple GUI (Graphical User Interface). With the help of tkinter framework user can create a simplest graphical user interface elements using the widgets found in the Tk toolkit


How to Create a Digital clock using Python Programming language | Python GUI | Code Hub

Digital Clock with Python programming language:

I'll demonstrate how to use Python to make a digital clock in this section. The Tkinter library in Python, a built-in package that comes with Python, can be used for this straightforward task. The cool features of Tkinter can be used to create easy-to-use applications.

Source code:

from tkinter import Label, Tk 

import time

app_window = Tk() 

app_window.title("Digital-Clock") 

app_window.geometry("420x150") 

app_window.resizable(1,1)


text_font= ("Boulder", 68, 'bold')

background = "#707070"

foreground= "#68f76d"

border_width = 25


label = Label(app_window, font=text_font, bg=background, fg=foreground, bd=border_width) 

label.grid(row=0, column=1)


def digital_clock(): 

   time_live = time.strftime("%H:%M:%S")

   label.config(text=time_live) 

   label.after(200, digital_clock)


digital_clock()

app_window.mainloop()(code-box)


Video output :



Output:

How to Create a Digital clock using Python Programming language | Python GUI | Code Hub


Tags

Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
Youtube Channel Image
MM4Tech Subscribe To watch more Tutorials
Subscribe