vendredi 16 avril 2021

Python Password Generator with TKInter

I am coding a password generator with an interface for school and I can't seem to find out where to put the password generator piece in my program.

import random
from tkinter import *

characters = "abcdefABCDEF1234!@#$"

length = 8

window = Tk()

window.title('Password Generator')

while True:
    input("Press Enter to generate new password")
    password = "".join(random.sample(characters, length))
    print(password)

label = Label (window, print(password))

label.pack(padx = 200, pady = 50)

window.mainloop()



Aucun commentaire:

Enregistrer un commentaire