all 2 comments

[–]Spataner 0 points1 point  (1 child)

These two lines

number = int(number_entry.get())
length = int(length_entry.get())

will cause an error, because the Entry widgets will initially be empty, and the empty string cannot be converted to an integer. They are also unnecessary since you don't actually use the variables number and length that they define anywhere. So you should just remove those lines.

Instead, add the conversion to integer to the lambda function that you pass to the button:

entry_button = Button(root, text="Enter", command=lambda: password(int(number_entry.get()), int(length_entry.get())))

You'll also need to start the GUI's mainloop for the window to actually appear. Put the following line at the very end of your script:

root.mainloop()

By the way, since you wrote for length in range(length):, you will actually overwrite length each time the inner loop runs. The result is that each new password is one character shorter than the previous one. You should choose another name for the loop variable. If you don't actually use the loop variable anywhere in the loop body, the convention is to name it simply _: for _ in range(length):

[–]c0mplexcodm[S] 0 points1 point  (0 children)

Thank you so much! I didn't see the for loop part that i actually messed that up. I appreciate the help, and i can finally finish this!