File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11import string
22import 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
517def 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
2133while True :
2234 input ("Press enter to generate a new password." )
23- print (generate_password ())
35+ print (COLORS [ 'cyan' ] + generate_password () + COLORS [ 'reset' ] )
You can’t perform that action at this time.
0 commit comments