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
34 changes: 19 additions & 15 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import random
import string
from tkinter.messagebox import YES

chars = "abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#$%^&*()"
def print_2_file(password):
if(file_flag == "Y"):
pass_file = open("pass.txt", "a")
pass_file.write(password + "\n")
pass_file.close()


while 1:
main

print("Please note that password with length lower than 8 is not recommended for security reasons!")
file_flag = (input("Would you like your passwords to be stored in a file (Y/N)"))
password_len = int(input("What length would you like your password to be :"))
print("Would you like special characters? yes/no")
if(input() == "yes"):
Expand All @@ -19,7 +27,11 @@
for x in range(0, password_len):
password_char = random.choice(chars)
password = password + password_char
print ("Here is your password: ", password)
print ("Here is your password: ", password)
if(file_flag == "Y"):
print_2_file(password)
else:
continue
else:
continue
else:
Expand All @@ -29,16 +41,8 @@
for x in range(0, password_len):
password_char = random.choice(chars)
password = password + password_char
print ("Here is your password: ", password)


print("Note: recommended minimum password length is 8 characters")
password_len = int(input("What length would you like your password to be :"))
password_count = int(input("How many passwords would you like: "))
for x in range(0, password_count):
password = ""
for x in range(0, password_len):
password_char = random.choice(chars)
password = password + password_char
print("Here is your password: ", password)
main
print ("Here is your password: ", password)
if(file_flag == "Y"):
print_2_file(password)
else:
continue