From 12bead96c01d9aabfaacd2453f3c1250e67a1486 Mon Sep 17 00:00:00 2001 From: Varsheni P <93462387+pvarsh10@users.noreply.github.com> Date: Sat, 28 Oct 2023 08:43:58 +0530 Subject: [PATCH] Create clock.py --- clock.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clock.py diff --git a/clock.py b/clock.py new file mode 100644 index 0000000..4bdbc70 --- /dev/null +++ b/clock.py @@ -0,0 +1,16 @@ +import tkinter as tk +import time + +def update_time(): + current_time = time.strftime("%H:%M:%S") + label.config(text=current_time) + root.after(1000, update_time) + +root = tk.Tk() +root.title("Clock") + +label = tk.Label(root, text="", font=("Helvetica", 48)) +label.pack(pady=20) + +update_time() +root.mainloop()