We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents af7939a + d582286 commit 4fbf111Copy full SHA for 4fbf111
Python clock/main.py
@@ -0,0 +1,27 @@
1
+#Before running program, install the ds-digital font fron the link: - https://www.dafont.com/ds-digital.font
2
+
3
+# Importing tkinter module
4
+from tkinter import *
5
+from tkinter.ttk import *
6
7
+# Get system's time
8
+from time import strftime
9
10
+root = Tk()
11
+root.title('Clock')
12
13
+# Display time on label
14
+def time():
15
+ string = strftime('%I:%M:%S %p')
16
+ lbl.config(text=string)
17
+ lbl.after(1000, time)
18
19
+# Font and background color
20
+lbl = Label(root, font=('ds-digital', 80),
21
+ background='black',
22
+ foreground='cyan')
23
24
+# Putting the clock in the middle
25
+lbl.pack(anchor='center')
26
+time()
27
+mainloop()
0 commit comments