Bonjour,
J'arrive à afficher un compte à rebours inférieur à 1h :
Mais comment afficher un compte à rebours supérieur à 1h ? Le code ci-dessous affiche toujours 1h de plus au chrono :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from tkinter import * from time import * def affiche(): actu=time() reste=int(round(fin-actu)) reste_ST=localtime(reste) L.config(text=strftime("%M:%S",reste_ST)) fen.after(1000,affiche) fen=Tk() fen.geometry("300x50") L=Label(fen,text="heure") L.place(x=10,y=10) fin=time()+3600 affiche() fen.mainloop()
Merci pour votre aide.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from tkinter import * from time import * def affiche(): actu=time() reste=int(round(fin-actu)) reste_ST=localtime(reste) L.config(text=strftime("%H:%M:%S",reste_ST)) fen.after(1000,affiche) fen=Tk() fen.geometry("300x50") L=Label(fen,text="heure") L.place(x=10,y=10) fin=time()+3610 affiche() fen.mainloop()
Partager