-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClocky.py
More file actions
29 lines (23 loc) · 713 Bytes
/
Copy pathClocky.py
File metadata and controls
29 lines (23 loc) · 713 Bytes
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
import tkinter as tk
from tkinter import font
import time
def update_clock():
#current_time = time.strftime("%H:%M:%S")
current_time = time.strftime("%I:%M:%S %p")
clock.config(text=current_time)
clock.after(1000, update_clock)
root = tk.Tk()
root.overrideredirect(True)
root.geometry("110x40+0+0")
root.lift()
root.wm_attributes("-topmost", True)
root.config(bg='white')
root.attributes("-alpha", 0.8)
clock = tk.Label(root, font=("calibri", 15, "bold"), bg='white')
clock.pack(fill="both", expand=True)
# Add borders
clock.config(bd=2, relief="solid")
# Position the window at the top-right corner
root.geometry("+%d+%d" % (root.winfo_screenwidth()-110, 0))
update_clock()
root.mainloop()