FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Python-Programs/DigitalClock.py at Test · gitishman/Basic-Python-Programs · GitHub
gitishman
/
Basic-Python-Programs
Public
forked from
souravjain540/Basic-Python-Programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Python-Programs
/
DigitalClock.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (25 loc) · 642 Bytes
Breadcrumbs
Basic-Python-Programs
/
DigitalClock.py
Copy path
File metadata and controls
31 lines (25 loc) · 642 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# importing whole module
from
tkinter
import
*
from
tkinter
.
ttk
import
*
# importing strftime function to
# retrieve system's time
from
time
import
strftime
# creating tkinter window
root
=
Tk
()
root
.
title
(
'Clock'
)
# This function is used to
# display time on the label
def
time
():
string
=
strftime
(
'%H:%M:%S %p'
)
lbl
.
config
(
text
=
string
)
lbl
.
after
(
1000
,
time
)
# Styling the label widget so that clock
# will look more attractive
lbl
=
Label
(
root
,
font
=
(
'calibri'
,
40
,
'bold'
),
background
=
'purple'
,
foreground
=
'white'
)
# Placing clock at the centre
# of the tkinter window
lbl
.
pack
(
anchor
=
'center'
)
time
()
mainloop
()
Back
|
FazBrowse Home
|
New Git URL