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()
It's hard to understand what exactly you are trying to achieve. Since it is a password generator, based on your previous code and my assumption, I have made some changes to your code. It generates and displays a new password on every button click.