-
Notifications
You must be signed in to change notification settings - Fork 27
/
app.py
32 lines (24 loc) · 801 Bytes
/
app.py
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
32
from time import strftime
from tkinter import Label, Tk
# ======= Configuring window =========
window = Tk()
window.title("")
window.geometry("200x80")
window.configure(bg="green") # =======Background of the clock=====
window.resizable(False, False) # =====setting a fixed window size =======
clock_label = Label(
window, bg="black", fg="cyan", font=("Arial", 30, "bold"), relief="flat"
)
clock_label.place(x=20, y=20)
def update_label():
"""
This function will update the clock
every 80 milliseconds
"""
current_time = strftime("%H: %M: %S\n %d-%m-%Y ")
clock_label.configure(text=current_time)
clock_label.after(80, update_label)
clock_label.pack(anchor="center")
update_label()
window.mainloop()
# ==============The end by github.com/kalebu ==========