Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
549 B
0
Indexable
Never
import tkinter as tk

def change_color():
    current_color = label.cget("fg")
    new_color = "blue" if current_color == "red" else "red"
    label.config(fg=new_color)
    label.after(2000, change_color)

window = tk.Tk()
window.configure(bg="blue")

label = tk.Label(window, text="ahoj", font=("Arial", 24), fg="red", bg="blue")
label.pack(expand=True)

screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
window.geometry(f"{screen_width}x{screen_height}+0+0")

window.after(2000, change_color)
window.mainloop()