1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| racine=Tkinter.Tk()
texte=Tkinter.Label(racine, text="Matricule", fg="black")
bouton=Tkinter.Button(racine, text="OK", command=lambda: save(valsaisir.get(),racine,saisie))
boutonESC=Tkinter.Button(racine, text="Fermer", command=racine.quit())
valsaisir=Tkinter.StringVar() #variable to get value
saisie=Tkinter.Entry(textvariable=valsaisir, width=30)
cpt=0
def MyTimer:
cpt = int(cpt)+1
if(cpt > 2):
#racine.withdraw()
isOpen = False
showroot(1)
#cpt = 0
print "connecte"
else:
print now.strftime("%d/%m/%YT%H:%M:%S")
#fen_matricule(racine)
showroot(0)
isOpen = True
threading.Timer(tempo, MyTimer, [cpt,isOpen,tempo]).start()
def showroot(param):
if param == 0:
texte.config(text='Matricule')
bouton.pack(side=Tkinter.BOTTOM)
boutonESC.pack_forget()
else:
texte.config(text='Le serveur répond de nouveau')
bouton.pack_forget()
boutonESC.pack(side=Tkinter.BOTTOM)
saisie.pack_forget()
racine.deiconify()
def hideme():
racine.withdraw()
MyTimer(cpt,isOpen,float(time))
hideme()
racine.mainloop() |
Partager