Full screen clock on computer monitor
Project - to display the clock on the computer screen. Can be used as wallpaper.
from tkinter import *
from time import strftime
import time
window = Tk()
window.configure(background = 'black')
window.bind('<Escape>', lambda e: window.destroy())
window.attributes ('-fullscreen', True)
time1 = ''
w= 'white'
b='black'
clock = Label(window, bg = b, fg = w, font=('calibri light bold', 110))
clock.pack(padx=100, pady=400)
def tik_tak():
global time1 get the current local time from the PC
time2 = time.strftime('%H:%M:%S') if time changed, update it
if time2 != time1:
time1 = time2
clock.config(text=time2)
clock.after(1000, tik_tak) loop, function tik_tak run again and again, every 1 second
tik_tak()
window.mainloop()
from tkinter import *
from time import strftime
import time
window = Tk()
window.configure(background = 'black')
window.bind('<Escape>', lambda e: window.destroy())
window.attributes ('-fullscreen', True)
time1 = ''
w= 'white'
b='black'
clock = Label(window, bg = b, fg = w, font=('calibri light bold', 110))
clock.pack(padx=100, pady=400)
def tik_tak():
global time1 get the current local time from the PC
time2 = time.strftime('%H:%M:%S') if time changed, update it
if time2 != time1:
time1 = time2
clock.config(text=time2)
clock.after(1000, tik_tak) loop, function tik_tak run again and again, every 1 second
tik_tak()
window.mainloop()