-
Notifications
You must be signed in to change notification settings - Fork 1
/
password_generator.py
39 lines (30 loc) · 1.03 KB
/
password_generator.py
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
# password_generator.py
import sys
from password_functions import generate_basic_password, generate_advanced_password
def main():
header = "Password Generator"
footer = "Made by naimur"
print("=" * len(header))
print(header)
print("=" * len(header))
if len(sys.argv) == 2 and sys.argv[1].isdigit():
password_length = int(sys.argv[1])
else:
password_length = int(input("Enter the password length: "))
print("\nChoose password type:")
print("1. Basic password")
print("2. Advanced password")
option = input("Enter your choice (1 or 2): ")
if option == "1":
password = generate_basic_password(password_length)
elif option == "2":
password = generate_advanced_password(password_length)
else:
print("Invalid option. Exiting.")
return
print(f"\nGenerated Password: {password}")
print("\n" + "=" * len(footer))
print(footer)
print("=" * len(footer))
if __name__ == "__main__":
main()