Skip to content

Commit bb2f8a5

Browse files
Digital clock using python
1 parent 4848b41 commit bb2f8a5

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

DigitalClock.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import tkinter
2+
from time import strftime
3+
4+
top = tkinter.Tk()
5+
top.title('Digital Clock')
6+
# 0,0 makes the window non-resizable
7+
top.resizable(0,0)
8+
9+
def time():
10+
# %p defines AM or PM
11+
string = strftime('%H: %M: %S %p')
12+
clockTime.config(text=string)
13+
clockTime.after(1000, time)
14+
15+
clockTime = tkinter.Label(top, font=('courier new', 40),
16+
background='red',foreground='black')
17+
clockTime.pack(anchor='center')
18+
time()
19+
top.mainloop()

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
# Python Scripts
22

3-
# Script 1 - Turtle Graphics
3+
## Script 1 - Turtle Graphics
44

55
Code using turtle graphics
66
TurtleGraphics.py
77

8-
# Script 2 - Popup Window
8+
## Script 2 - Popup Window
99

1010
Displaying a popup window
1111
DisplayPopupWindow.py
1212

13-
# Script 3 - Take a break
13+
## Script 3 - Take a break
1414

1515
Python code to take a break while working long hours
1616
TakeABreak.py
1717

18-
# Script 4 - Chessboard
18+
## Script 4 - Chessboard
1919

2020
Create a chesboard using matplotlib
2121
ChessBoard.py
2222

23-
# Script 5 - Font Art
23+
## Script 5 - Font Art
2424

2525
Display a font art using python
2626
FontArt.py
2727

28-
# Script 6 - Video Downloader
28+
## Script 6 - Video Downloader
2929

3030
VideoDownloader.py
3131

32-
# Script 7 - Fake Profiles
32+
## Script 7 - Fake Profiles
3333

3434
Get many fake profiles using python
35-
FakeProfile.py
35+
FakeProfile.py
36+
37+
## Script 8 - Digital Clock
38+
39+
DigitalClock.py

0 commit comments

Comments
 (0)