This simple Python script generates a random password of a specified length using the secrets
module. It includes a variety of characters, such as letters (both uppercase and lowercase), digits, and punctuation.
Make sure you have Python installed on your system. You can download it from python.org.
-
Clone the repository or download the script.
git clone https://github.com/yourusername/random-password-generator.git
-
Navigate to the directory where the script is located.
cd random-password-generator
-
Run the script.
python password_generator.py
-
Enter the desired length for your password when prompted.
How many characters your password will be? 12
-
The script will generate a random password and display it on the screen.
Generated Password: q#7Fg$p2L!xZ
-
You can run the script multiple times with different lengths to generate passwords of varying lengths.
Feel free to customize the script according to your needs. You can modify the character sets used in the password generation by editing the following line:
password = ''.join((secrets.choice(string.ascii_letters + string.digits + string.punctuation)) for i in range(x))
For example, if you want to exclude punctuation characters, you can modify it as follows:
password = ''.join((secrets.choice(string.ascii_letters + string.digits)) for i in range(x))
If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request. Contributions are welcome!
For any queries or feedback, please contact ema.ventrella@gmail.com.