Skip to content

Commit d7c431e

Browse files
authored
Merge pull request #317 from Mukulbaid63/digital_clock
Digital clock added
2 parents 7790945 + cb21b9b commit d7c431e

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

Python/Digital_clock/Digital-clock.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#import Requried libraries
2+
from time import ctime
3+
from tkinter import *
4+
from threading import *
5+
6+
#time
7+
def cTime():
8+
while(True):
9+
c=ctime()
10+
c=c.split()
11+
# configure the time
12+
lbl.config(text = c[3])
13+
14+
#Creating GUI
15+
main = Tk()
16+
17+
#Title
18+
main.title('Clock')
19+
20+
#lable to show Time
21+
lbl = Label(main, font = ('calibri', 40, 'bold'),background = 'Black', foreground = 'white')
22+
lbl.pack(anchor = 'center')
23+
24+
#Create new thread
25+
thread=Thread(target=cTime)
26+
thread.start()
27+
28+
main.mainloop()

Python/Digital_clock/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## GUI FOR DIGITAL WATCH
2+
- This script is built in Python, for digital clock.
3+
- The time and tkinter Libraries are used to built this scripts.
4+
5+
## Requirements
6+
- tkinter module
7+
- time module
8+
9+
## Working
10+
![DigitalClock](demo.gif)
11+
- The script runs and digital clock is appear by the GUI.

Python/Digital_clock/demo.gif

131 KB
Loading

0 commit comments

Comments
 (0)