-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpassword_genrator.py
More file actions
47 lines (33 loc) · 1.33 KB
/
Copy pathpassword_genrator.py
File metadata and controls
47 lines (33 loc) · 1.33 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
import random,pyperclip
def passwordGenerator(l):
generated_password = ""
for i in range(1, l+1):
generated_password += random.choice(combined_list)
print(generated_password)
prompt = input("Do you want to copy it to your clipboard?(y/n): ")
if prompt == 'y' or prompt == 'yes':
pyperclip.copy(generated_password)
print("Copied succefully! GO paste it now")
else:
print("Thank you for using!")
Digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
Lcase_characters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h',
'i', 'j', 'k', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z']
Ucase_characters = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
'I', 'J', 'K', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',
'Z']
Symbols = ['@', '#', '$', '%', '=', ':', '?', '.', '/', '|', '~', '>',
'*', '(', ')', '<']
combined_list = Lcase_characters + Ucase_characters + Symbols + Digits
random.shuffle(combined_list)
try:
user_length = int(input("Lengt--> "))
if user_length >= 8:
passwordGenerator(user_length)
else:
print("Lenght is too less")
except ValueError:
print("Lenght in number no string.")