CODE:
import sys
from tkinter import*
import time
#for importing sys, tkinter, time
#open cmd in pc and type pip install sys
def tick():
time_string=time.strftime("%H:%M:%S")
clock.config(text=time_string)
clock.after(200,tick)
root=Tk()
clock=Label(root, font=("times", 35,"bold"), bg="pink")
#you can change font size and color
clock.grid(row=0, column=1)
tick()
root.mainloop()
OUTPUT:
Comments
Post a Comment