A menu-driven, console-based password generator built entirely with the Python Standard Library. It generates cryptographically secure random passwords from letters and numbers, with full input validation and a continuously running menu until the user chooses to exit.
This project was built as Project 3 for the Python Programming Internship at DecodeLabs, following the official assignment requirements for a Core Python CLI password generator.
The application asks the user for a desired password length, validates that input, and generates a random password made up of uppercase letters, lowercase letters, and digits. It runs in a loop, presenting a menu of options, until the user explicitly selects Exit. Nothing is written to disk β all settings and generated passwords exist only for the duration of a single run.
| # | Feature | Description |
|---|---|---|
| 1 | Generate Password | Creates one random password using the current length setting. |
| 2 | Change Password Length | Updates the active password length (4β128 characters), with the option to cancel. |
| 3 | Generate Multiple Passwords | Generates a user-specified batch of passwords (up to 50) in one go. |
| 4 | View Current Settings | Displays the active password length and character pool details. |
| 5 | Reset Settings | Restores the password length to the application default (12). |
| 6 | Exit | Ends the program with a closing message. |
Input validation rejects empty input, non-numeric values, zero, and negative numbers for every prompt β the program never crashes on bad input.
- Language: Python 3
- Standard Library Modules:
- No external packages, GUI frameworks, databases, or file storage
Password_Generator_Project/
βββ main.py # Complete application source code
βββ README.md # Project documentation (this file)
βββ LICENSE # MIT License
βββ .gitignore # Python ignore rules
βββ PROJECT_STRUCTURE.md # Explanation of every file
βββ screenshots/ # Real terminal screenshots
βββ home.png
βββ generate-password.png
βββ multiple-passwords.png
βββ change-length.png
βββ current-settings.png
βββ reset-settings.png
βββ invalid-input.png
βββ invalid-length.png
βββ exit.png
Clone the repository:
git clone https://github.com/PawanChoudhary0607/Python-Password-Generator.git
cd Python-Password-GeneratorNo additional dependencies need to be installed β the project uses only the Python Standard Library.
Requires Python 3.x.
python3 main.pyOn Windows:
python main.py- The application starts and displays a welcome message with the default password length (12).
- The main menu is displayed with six options.
- The user selects an option by entering a number from 1 to 6.
- Invalid input (empty, non-numeric, or out of range) is rejected and the user is re-prompted.
- The selected action runs (generate, change length, generate multiple, view settings, or reset).
- The menu is displayed again, and the loop continues until the user selects Exit.
========================================
RANDOM PASSWORD GENERATOR
========================================
1. Generate Password
2. Change Password Length
3. Generate Multiple Passwords
4. View Current Settings
5. Reset Settings
6. Exit
========================================
Select an option (1-6): 1
Generated Password: BQWTWjyHrTDz
Building this project reinforced:
- Designing a modular, function-based CLI application with a clear separation between input validation, core logic, and menu handling
- Writing robust input validation that gracefully handles empty, non-numeric, zero, and negative input without crashing
- Using
secrets.choice()for cryptographically secure random selection instead of the general-purposerandommodule - Structuring a continuously running menu loop with clean exit
handling, including
KeyboardInterruptandEOFError - Writing PEP8-compliant, well-commented, professional Python code
These are potential directions for future versions, not features included in the current implementation:
- Optional inclusion of special characters and uppercase/lowercase toggles
- Password strength indicator
- Copy-to-clipboard support
- Exporting generated passwords to an encrypted local file
Pawan Choudhary B.Tech CSE (AI & ML) Python Programming Intern @ DecodeLabs
GitHub: https://github.com/PawanChoudhary0607
This project is licensed under the MIT License.








