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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| import Tkinter
from Tkinter import *
import time
import tkMessageBox as Msg
import random
import tkSimpleDialog as Saisie
def pirater():
question = Msg.askquestion(title="question",message="Vous etes sur le point de pirater la base de donnee de la N.A.S.A voullez vous continuer ?")
if question == 'yes':
t=Tkinter.Toplevel()
t.title("piratage de la N.A.S.A")
t.geometry("%dx%d+%d+%d" % (200,100, (racine.winfo_screenwidth()-200)/2, (racine.winfo_screenheight()-100)/2 ) )
# t.iconbitmap("py.ico")
t.grab_set()
t.focus_set()
Cadre=Tkinter.Frame(t)
Cadre.pack()
piraterok=Tkinter.Label(Cadre, text="La base de donnee de la N.A.S.A est \n en train d'etre pirater veuillez patientez!", fg="black")
piraterok.pack(side=Tkinter.TOP)
ilreste = Tkinter.Label(Cadre, text="Il reste :", fg="black")
ilreste.pack(side=Tkinter.LEFT)
temp = random.randint(1, 60)#choisie un nombre entre 1 et 50
while (temp > 0): # (n'oubliez pas le double point !)
afichetemp = Tkinter.Label(Cadre, text=temp, fg="black")
segondes = Tkinter.Label(Cadre, text="segondes", fg="black")
afichetemp.pack(side=Tkinter.LEFT)
segondes.pack(side=Tkinter.LEFT)
print temp
temp = temp - 1 # (n'oubliez pas l'indentation !)
time.sleep(1)
afichetemp.forget()
segondes.forget()
if (temp == 0):
t.destroy()
info = Msg.showinfo(title="Clean",message="Le piratage de la base de donnee de la N.A.S.A a bien ete pirater !")
if (question == 'no'):
racine.destroy()
racine=Tkinter.Tk()
racine.geometry("%dx%d+%d+%d" % (400,300, (racine.winfo_screenwidth()-400)/2, (racine.winfo_screenheight()-300)/2 ) )
racine.title("teste de toute les boite a message !")
#racine.iconbitmap("py.ico")
racine.withdraw()
chaine= Saisie.askstring(title="Private Access", prompt="\n Password please :\n")
bouton_pirater =Tkinter.Button(racine, text="Delete database", command=pirater)
bouton_pirater.pack()
quitter=Tkinter.Button(racine, text="Quit", command=racine.destroy)
quitter.pack()
p = "no"
while (p != "yes"):
if (chaine != "tim123"):
chaine= Saisie.askstring(title="Private Access", prompt="\n Password please :\n")
else:
p = "yes"
racine.deiconify()
if __name__ == "__main__":
racine.mainloop() |
Partager