Correction exercices les dates en python
Correction exercices les dates en python
-
Objectifs
- Etre capable de manipuler les dates en Python
-
Exercice 01
-
Énoncé
- Vous pouvez visualiser l’énoncé de l’exercice
-
Correction
from tkinter import *
from tkinter.ttk import *
from time import strftime
root = Tk()
root.title('Horloge')
def time():
string = strftime('%H:%M:%S %p')
lbl.config(text = string)
lbl.after(1000, time)
lbl = Label(root, font = ('calibri', 40, 'bold'),
foreground = 'black',
borderwidth=20, relief="solid")
lbl.pack(padx=20, pady=20,anchor = 'center')
root.configure(bg='red')
time()
mainloop()
