-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPassGenTwo.py
More file actions
50 lines (45 loc) · 1.54 KB
/
Copy pathPassGenTwo.py
File metadata and controls
50 lines (45 loc) · 1.54 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
import random, os, time
run = True
unset = True
while run:
password = ""
cha = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","<",">","/","?","!","@","#","$","%","^","&","*","(",")","_","-","+","=","[","]","{","}",":",";","1","2","3","4","5","6","7","8","9","0"]
asking = True
if unset:
amount = int(input("How many characters do you want in your password? "))
unset = True
print("Creating password with {} charcters" .format(amount))
for i in range(amount):
password += random.choice(cha)
print(password + "\n")
asking = True
while asking:
ask = int(input("Do you want to: (1/2/3/4)\n 1. Create a new password\n 2. Create new password with same amount of characters\n 3. Quit the program\n 4. Quit and show password\n"))
if ask == 1:
print("1: Create a new password")
asking = False
time.sleep(2)
os.system("clear")
elif ask == 2:
print("2: Create new password with same amount of characters")
asking = False
unset = False
time.sleep(2)
os.system("clear")
elif ask == 3:
print("3: Quit the program")
asking = False
run = False
time.sleep(2)
os.system("clear")
elif ask == 4:
print("4: Quit and show password")
time.sleep(2)
os.system("clear")
asking = False
run = False
print(password)
else:
print("Invalid. Choose from: (1/2/3/4)")
time.sleep(2)
os.system("clear")