Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from random import *
- import string
- #Logiciel
- def creer_mdp():
- password_min = 8
- password_max = 15
- all_chars = string.ascii_letters + string.punctuation + string.digits
- password = "" .join(choice(all_chars) for x in range(randint(password_min, password_max)))
- entry.delete(0, END)
- entry.insert(0, password)
- def copy_txt():
- file = open("mes_mdp.txt", "a")
- file.write("\n"+password)
- file.close()
- #création de fenetre
- window = Tk()
- window.title("WonderWord")
- #taille
- window.geometry("1080x720")
- window.minsize(1080, 720)
- #aspect
- window.config(background='#2168DD')
- #frame
- frame = Frame(window, bg='#2168DD')
- frame1 = Frame(frame, bg='#2168DD')
- #images
- width = 300
- height = 300
- image = PhotoImage(file="password.png").zoom(15).subsample(32)
- canvas = Canvas(frame, width=width, height=height, bg='#2168DD', bd=0, highlightthickness=0)
- canvas.create_image(width/2, height/2, image=image)
- canvas.grid(row=0, column=0, sticky=W)
- #Titre
- label = Label(frame1, text="PASSWORD", font=("Helvetica", 30), bg='#2168DD', fg='white')
- label.pack()
- #champ
- entry = Entry(frame1, font=("Helvetica", 30), bg='#2168DD', fg='white')
- entry.pack()
- #bouton
- button = Button(frame1, text="Generate", font=("Courrier", 30), bg='#2168DD', fg='white', command=creer_mdp)
- button.pack(fill=X)
- copy = Button(frame1, text=".TXT", font=("Courrier", 30), bg='#00C533', fg='white', command=copy_txt)
- copy.pack()
- frame.pack(expand=YES)
- frame1.grid(row=0, column=1, sticky=W)
- #icon
- window.iconbitmap("logo.ico.ico")
- #affichage
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement