Toujours le module Time

J’ai fait un copié-collé de l’horloge de Vladimir et j’ai modifié l’affichage.


import time
import os

while True:
os.system('clear')
os.system('cls')
time.sleep(0.001)
current_time_year = time.localtime (time.time()).tm_year
current_time_mon = time.localtime (time.time()).tm_mon
current_time_day = time.localtime (time.time()).tm_mday
current_time_hour = time.localtime (time.time()).tm_hour
current_time_min = time.localtime (time.time()).tm_min
current_time_sec = time.localtime (time.time()).tm_sec
print()
print("Je suis une horloge. Ctrl+c pour me quitter")
print()
print (" ",current_time_day,"/",current_time_mon,"/",current_time_year)
print (" ",current_time_hour,":",current_time_min,":",current_time_sec)
time.sleep(1)