| 66 | |
| 67 | |
| 68 | class Run: |
| 69 | def decide_operation(self): |
| 70 | user_input = input(": ") |
| 71 | try: |
| 72 | int(user_input) |
| 73 | except: |
| 74 | Interface.change_has_characters(user_input) |
| 75 | else: |
| 76 | Interface().generate_password(int(user_input)) |
| 77 | finally: |
| 78 | print("\n\n") |
| 79 | |
| 80 | def run(self): |
| 81 | menu = f"""Welcome to the PassGen App! |
| 82 | Commands: |
| 83 | generate password -> |
| 84 | <lenght of the password> |
| 85 | |
| 86 | commands to change the characters to be used to generate passwords: |
| 87 | {list_to_vertical_string(Interface.has_characters.keys())} |
| 88 | """ |
| 89 | print(menu) |
| 90 | while True: |
| 91 | self.decide_operation() |
| 92 | |
| 93 | |
| 94 | Run().run() |