Function
get_input
(prompt, default="", input_type=str)
Source from the content-addressed store, hash-verified
| 668 | print() |
| 669 | |
| 670 | def get_input(prompt, default="", input_type=str): |
| 671 | try: |
| 672 | user_input = input(f"{Colors.CYAN}[?] {prompt} [{default}]: {Colors.RESET}").strip() |
| 673 | if not user_input: |
| 674 | return default |
| 675 | return input_type(user_input) |
| 676 | except ValueError: |
| 677 | print(f"{Colors.RED}[!] Invalid input, using default: {default}{Colors.RESET}") |
| 678 | return default |
| 679 | |
| 680 | def main(): |
| 681 | # Auto-install dependencies on first run |
Tested by
no test coverage detected