Code:
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #----- imports from Tkinter import * import os #---------- Fonctions def compiler(): image_ = str(nom_image.get()) archive_ = str(nom_archive.get()) os.system("cat "+archive_ + " >> "+image_) if image_ == "" or archive_ == "": fenerror = Tk() fenerror.title('ERROR') fenerror.geometry("150x80+400+400") fenerror.configure(bg = "black") labelerror = Label(fenerror) labelerror.configure(text = "L'un des 2 champs n'est\npas correctement renseigné") labelerror.configure(bg = "black", fg = "orange") labelerror.pack() labelerror.grid(row =1, column =1) espaceerror = Label(fenerror) espaceerror.configure(text = "") espaceerror.configure(bg = "black", fg = "orange") espaceerror.pack() espaceerror.grid(row =2, column =1) buttonerror = Button(fenerror,text=' Ok ',command=fenerror.destroy) buttonerror.configure(bg = "black", fg="green") buttonerror.pack() buttonerror.grid(row =3, column =1) else: #------------------------------------deuxieme fenetre fen = Tk() fen.title('PyHide-hacker') fen.geometry("180x90+500+450") fen.configure(bg = "black") monlabel = Label(fen) monlabel.configure(text = "Merci d'avoir utilisé PyHideHacker\ncordialement , IceF0x") monlabel.configure(bg = "black", fg = "orange") monlabel.pack() monlabel.grid(row =1, column =1) espacemini = Label(fen) espacemini.configure(text = "") espacemini.configure(bg = "black", fg = "orange") espacemini.pack() espacemini.grid(row =2, column =1) button = Button(fen,text=' Ok ',command=fen.destroy) button.configure(bg = "black", fg="green") button.pack() button.grid(row =3, column =1) #-------------fenetre root = Tk() root.title('PyHide-hacker') root.geometry("290x180+500+450") root.configure(bg = "black") #---------- Espacement des fenetres espace = Label(root) espace.configure(text = "") espace.configure(bg = "black", fg = "orange") espace.pack() espace.grid(row =1, column =1) espace2 = Label(root) espace2.configure(text = "") espace2.configure(bg = "black", fg = "orange") espace2.pack() espace2.grid(row =3, column =1) espace3 = Label(root) espace3.configure(text = "") espace3.configure(bg = "black", fg = "orange") espace3.pack() espace3.grid(row =5, column =1) espace4 = Label(root) espace4.configure(text = "") espace4.configure(bg = "black", fg = "orange") espace4.pack() espace4.grid(row =7, column =1) #-------------- #-------------------------Labels label_image = Label(root) label_image.configure(text = " Image : ") label_image.configure(bg = "black", fg = "orange") label_image.pack() label_image.grid(row =2, column =1) label_archive = Label(root) label_archive.configure(text = " Archive : ") label_archive.configure(bg = "black", fg = "orange") label_archive.pack() label_archive.grid(row =4, column =1) #--------------------------------Entry nom_image = Entry(root) nom_image.bind("<Return>") nom_image.configure(bg = "black", fg = "purple") nom_image.pack() nom_image.grid(row =2, column =2) nom_archive = Entry(root) nom_archive.bind("<Return>") nom_archive.configure(bg = "black", fg = "purple") nom_archive.pack() nom_archive.grid(row =4, column =2) #--------------------------------Bouton button_compiler = Button(root,text='compresser',command=compiler) button_compiler.configure(bg = "black", fg="green") button_compiler.pack() button_compiler.grid(row =8, column =2) root.mainloop()
Commentaire