Advertisement
stellatedT

Clock Test.py

Aug 6th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from tkinter import *
  2. from time import *
  3.  
  4.  
  5.  
  6.  
  7.  
  8. def update():
  9.     time_string = strftime("%I:%M:%S %p")
  10.     time_label.config(text=time_string)
  11.  
  12.  
  13.     day_string = strftime("%A")
  14.     day_label.config(text=day_string)
  15.  
  16.     window.after(1000,update)
  17.  
  18. window = Tk()
  19.  
  20. time_label = Label(window,font=("ds-digital",50),fg="#00FF00",bg="black")
  21. time_label.pack()
  22.  
  23. day_label = Label(window,font=("Ink Free",25))
  24. day_label.pack()
  25.  
  26. update()
  27.  
  28. window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement