Digital clock using Python
Step 1 :- open IDLE and start typing the code.
Code:-
from tkinter import*
from tkinter.ttk import*
from time import strftime
root Tk(
root.title("clock")
def time():
string strftime(%H:%M:%S %p' )
label.config(text-string)
label.after(1000, time)
label-Label(root, font ("ds-digital",80), background="black", foreground="White") label.pack(anchor='center')
time()
mainloop()
( Click on the picture for clarity )
Step 2 :- Save the file
Step 3 :- Run the code and get the output.
Hope you got the output.
Watch the video for better understanding.
Subscribe my channel on YouTube and get more ideas ๐
YouTube Link :- https://www.youtube.com/channel/UC8U2tW9d8N_qosD8739Id5Q



Comments
Post a Comment