File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,13 @@ def generate_password(length=100):
2626 return password
2727
2828
29- # Generate a 100-character password
30- print (COLORS ['cyan' ] + generate_password () + COLORS ['reset' ])
29+ try :
30+ # Generate a 100-character password
31+ print (COLORS ['cyan' ] + generate_password () + COLORS ['reset' ])
3132
32- # Keep the script running
33- while True :
34- input ("Press enter to generate a new password." )
35- print (COLORS ['cyan' ] + generate_password () + COLORS ['reset' ])
33+ # Keep the script running
34+ while True :
35+ input ("Press enter to generate a new password." )
36+ print (COLORS ['cyan' ] + generate_password () + COLORS ['reset' ])
37+ except KeyboardInterrupt :
38+ print ("\n " + COLORS ['red' ] + "Generator Stopped" + COLORS ['reset' ])
You can’t perform that action at this time.
0 commit comments