Skip to content

Commit c6978d4

Browse files
Update digital_clock.py
I have updated the code as pre requested. Specifically, following the best practices that has been suggested
1 parent e95c756 commit c6978d4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Digital_Clock/digital_clock.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import tkinter as tk
32
import time
43
from tkinter.font import Font
@@ -25,21 +24,21 @@ def clocks():
2524
'''
2625
Here I created a instance of TK class
2726
'''
28-
window = Tk()
27+
window = tk.Tk()
2928
# creating a title
3029
window.title("Digital Clock")
3130
# creating background color
3231
window.config(bg="black")
3332

3433
font1 = Font(family="Arial", size=90, weight="normal")
3534
# creating a header using Label Widget
36-
header = Label(window, text="Time Clock", font=font1, bg="gray", fg="white")
35+
header = tk.Label(window, text="Time Clock", font=font1, bg="gray", fg="white")
3736
# using grid() to place the header somewhere comfortable in the gui
3837
header.grid(row=1, column=2)
3938
'''
4039
A clock is being constructed using the Label Widget, which exhibits the current time and is positioned using grid.
4140
'''
42-
clock = Label(window, font=("times", 90, "bold"), bg="blue", fg='white')
41+
clock = tk.Label(window, font=("times", 90, "bold"), bg="blue", fg='white')
4342
clock.grid(row=2, column=2, padx=620, pady=250)
4443

4544
'''

0 commit comments

Comments
 (0)