Untitled
unknown
plain_text
a year ago
644 B
9
Indexable
import tkinter as tk
from time import strftime
def update_time():
# Mise à jour du texte avec l'heure actuelle
time_string = strftime('%H:%M:%S')
label.config(text=time_string)
# Planification de la prochaine mise à jour dans 1000ms (1 seconde)
root.after(1000, update_time)
# Création de la fenêtre principale
root = tk.Tk()
root.title("Horloge Numérique")
# Création du label pour afficher l'heure
label = tk.Label(root, font=('calibri', 40, 'bold'))
label.pack(anchor='center', pady=20)
# Première mise à jour de l'heure
update_time()
# Lancement de la boucle principale
root.mainloop()Editor is loading...
Leave a Comment