How to make easy digital clock from python * easy Code * 100% working
๐ฐ๐ฐFollow the steps ::
1. First open the python in any virtual environment software like . vs code
2. Then create a new file in python
3.Named it whatever you want but use .py in the last for making this file for python like digitalclock.py
4. now follow my code :
from tkinter import Tk
from tkinter import Label
import time
import sys
master = Tk()
master.title("Digital Clock")
def get_time():
timeVar = time.strftime("%I:%M:%S %p")
clock.config(text=timeVar)
clock.after(200,get_time)
clock = Label(master, font=("Calibri",55),bg="grey",fg="black")
clock.pack()
get_time()
master.mainloop()
5.Make sure you Save it using (Ctrl + S )
6.Run this code
7. If you get error somehow then use my Code file for just click on download button
please comment down for any Quries
ReplyDelete