how to make a clock usig pytohn
import sys
from tkinter import *
import time
def times():
current_time=time.strftime("%H:%M:%S")
clock.config(text=current_time)
clock.after(200,times)
root=Tk()
root.geometry("500x250")
clock=Label(root,font=("times",50,"bold"),bg="black",fg='blue')
clock.grid(row=2,column=2,pady=25,padx=100)
times()
digi=Label(root,text="Digital clock",font="times 24 bold",fg="violet")
digi.grid(row=0,column=2)
nota=Label(root,text="hours minutes seconds ",font="times 15 bold")
nota.grid(row=3,column=2)
root.mainloop()
3.6
5
please subscribe my channel - https://bit.ly/2Me2CfB
from tkinter import *
import time
import playsound
root = Tk()
root.geometry('600x175')
root.title("Clock")
root.config(background='black')
def clock():
main_time = time.strftime("%H:%M:%S:%p")
lbl.config(text=main_time)
lbl.after(1000, clock)
lbl = Label(root, text="", font=('Digital Display Regular', 90), bg="black", fg="cyan")
lbl.pack(anchor=CENTER)
clock()
root.mainloop()
Thank you!
5
0
Are there any code examples left?
New code examples in category Python
-
Python 2023-04-11 03:04:20
-
Python 2022-03-27 22:40:04 pycharm no module named
-
Python 2022-03-27 22:25:05 assign multiple variablesin one line
-
Python 2022-03-27 22:20:02 levenshtein distance
-
Python 2022-03-27 21:35:09 get text from url python last slash
-
Python 2022-03-27 21:30:30 df concatenate df
-
Python 2022-03-27 21:25:09 python odd or even
-
Python 2022-03-27 21:15:32 python include function from another file
-
Python 2022-03-27 21:10:01 color module python
-
Python 2022-03-27 21:00:27 python tkinter cursor types