mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-03-30 01:16:46 +00:00
Digital-Clock
This commit is contained in:
parent
cf01d7a046
commit
38099714a6
24
Digital-Clock/Sourodip20kar.md
Normal file
24
Digital-Clock/Sourodip20kar.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Digital Clock
|
||||||
|
## code
|
||||||
|
```
|
||||||
|
import tkinter
|
||||||
|
from time import strftime
|
||||||
|
|
||||||
|
top = tkinter.Tk()
|
||||||
|
top.title('Digital Clock')
|
||||||
|
top.resizable(0,0)
|
||||||
|
|
||||||
|
def time():
|
||||||
|
string = strftime('%H: %M: %S %p')
|
||||||
|
clockTime.config(text=string)
|
||||||
|
clockTime.after(1000, time)
|
||||||
|
|
||||||
|
clockTime = tkinter.Label(top, font=('courier new', 40),
|
||||||
|
background='white',foreground='black')
|
||||||
|
clockTime.pack(anchor='center')
|
||||||
|
time()
|
||||||
|
top.mainloop()
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|

|
Loading…
x
Reference in New Issue
Block a user