-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator.py
More file actions
57 lines (45 loc) · 1.71 KB
/
generator.py
File metadata and controls
57 lines (45 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# modules
import random
from array import *
# intro
print("Hello welcome to random password generator 1.0 VOL")
print("")
# name
name = input("Enter your name : ")
# variables
password_charas = "abcdefuhijklmnopqrstuvwxyz*&%$#@!0987654321"
passwords = int(input("How many passwords do you want? : "))
pwdArray = ['']*passwords
password_length = int(input("How many characters do you want in your password? : "))
add_name = str(input("Do you want to add your name? (not recommended) [y/n] : "))
special_remarks = str(input("Any special remarks? : "))
# start generator
if add_name == 'y':
for i in range(0, passwords):
password = ""
for a in range(0, password_length):
password_characters = random.choice(password_charas)
password = password + password_characters
passwords_built = name + special_remarks + password
pwdArray[i]=passwords_built
print("Your password is: ",(pwdArray))
elif add_name == 'n':
for i in range(0, passwords):
password = ""
for a in range(0, password_length):
password_characters = random.choice(password_charas)
password = password + password_characters
passwords_built = special_remarks + password
pwdArray[i]=passwords_built
print("Your password is: ",(pwdArray))
# save password/s
save = input("Do you want to save your password? [y/n] : ")
if save == "y":
file = open(input("What is the name of your file? make sure to enter the file type : "),"a")
content=str(pwdArray)
file.write(content)
file.close()
elif save == "n":
print("OK Goodbye!")
else:
print("Nothing found")