-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (21 loc) · 651 Bytes
/
main.py
File metadata and controls
31 lines (21 loc) · 651 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
30
31
from tkinter import *
import time
root = Tk()
root.geometry("600x400")
def clock():
hour = time.strftime("%I")
minute = time.strftime("%M")
second = time.strftime("%S")
day = time.strftime("%A")
am_pm = time.strftime("%p")
my_label.config(text=hour + ":" + minute + ":" + second + " " + am_pm)
my_label.after(1000, clock)
my_label2.config(text = day)
def update():
my_label.config(text="New Text")
my_label = Label(root, text="", font=("Helvetica", 48), fg="green", bg="black")
my_label.pack(pady=20)
my_label2 = Label(root, text="", font=("Helvetica", 14))
my_label2.pack(pady=10)
clock()
root.mainloop()