Skip to content

Commit b8b91ee

Browse files
Update main.py
1 parent 3ae14e2 commit b8b91ee

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

main.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import string
22
import secrets
33

4+
# ANSI escape codes for some colors
5+
COLORS = {
6+
'red': '\033[31m',
7+
'green': '\033[32m',
8+
'yellow': '\033[33m',
9+
'blue': '\033[34m',
10+
'magenta': '\033[35m',
11+
'cyan': '\033[36m',
12+
'white': '\033[37m',
13+
'reset': '\033[0m',
14+
}
15+
416

517
def generate_password(length=100):
618
# Define the characters that will be used in the password
@@ -15,9 +27,9 @@ def generate_password(length=100):
1527

1628

1729
# Generate a 100-character password
18-
print(generate_password())
30+
print(COLORS['cyan'] + generate_password() + COLORS['reset'])
1931

2032
# Keep the script running
2133
while True:
2234
input("Press enter to generate a new password.")
23-
print(generate_password())
35+
print(COLORS['cyan'] + generate_password() + COLORS['reset'])

0 commit comments

Comments
 (0)