Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions Applications/Random Password Generator/random pass.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tkinter import *
import random
from random import sample
import string

root = Tk()
Expand All @@ -11,10 +11,7 @@
# function to generate the password
def get_pass():
pass1 = string.ascii_letters + string.digits + string.punctuation
password = ""

for x in range(pwd_len.get()): #loop to generate the user given length for password
password = password + random.choice(pass1)
password = "".join(sample(pass1, pwd_len.get()))
passstr.set(password)

#tkinter command to generate the gui
Expand All @@ -24,4 +21,4 @@ def get_pass():
Button(root, text="Generate Password", command=generate).pack(pady=15)
Entry(root, textvariable=passstr).pack(pady=2)

root.mainloop()
root.mainloop()