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
| # -*- coding: cp1252 -*-
from Tkinter import *
Fp = Tk()
v = StringVar() #importation de la zone de saisie StringVar
e = Entry(Fp, textvariable=v, width=50, fg="black")
e.pack() #insertion de la zone de saisie
Button(Fp, text="Annuler", command = Fp.destroy).pack(side=LEFT)
def verification():
e.get()
if e == "label": #mot de passe requis pour ouvrir le programme
root = Tk() #ouverture de la nouvelle fenêtre contenant le programme
root.title("Label")
champ_label = Label(root, text="1").pack() #Insertion des Labels
champ_label = Label(root, text="2").pack()
champ_label = Label(root, text="3").pack()
champ_label = Label(root, text="4").pack()
champ_label = Label(root, text="5").pack()
root.mainloop()
else:
champ_label = Label(Fp, text="Mot de pass incorrect !!!",background="red")
champ_label.pack()
champ_label.after(2000, champ_label.destroy)
Button(Fp, text="Valider", command = verification).pack(side=LEFT) #Bouton qui verifie que le mot de passe est bon
Fp.mainloop() |
Partager