Intro: How To: Creating a Random Password Generator With Python
In this tutorial, you will learn how to create a random password generator using python in just a few simple steps.
Step 1: Downloading IDLE
Go to Python.org. This link will take you directly to the download page for IDLE. It is completely free and you do not need to create an account either.
Step 2: Getting Started
All you need to do for this step is find the application IDLE on your computer and open it. When you first open the application you will not be able to edit any code on the current screen so go up to file and create a new one.
Step 3: Characters
The "import random" function allows you to take variables from the "chars" function. If you want the password to be harder to crack I strongly suggest adding more than just letters of the alphabet. I've added numbers, uppercase letters, and a few extra signs. Another great idea is to make them longer.
Step 4: Number of Passwords You Want
The "number" variable you see in the picture is used to represent the number of passwords you would like the program to generate.
Step 5: Length of the Password
The "length" variable is used to represent what? Yup, you guessed it, the length of your password. Another way to see it is; how many characters do you want your password to consist of?
Step 6: Almost Done
Next, add a "for" statement such as the one above. Below that, you have "password = ' ' ". What that is saying is that the characters we put into the apostrophes in the 3rd step are what is going to make up our password.
Step 7: Finishing Touches
In this step, the "c" variable stands for characters. You have "password +=" which may seem slightly strange, but what this is saying is you need to use += to add the new character to the password each time. The final piece you cannot forget is to print out the password.
Step 8: Thank You for Your Time and Hopefully Your Vote
A quick disclaimer this is not an original idea of mine. I found a tutorial on the internet and was very intrigued by it. The tutorial I found was very lengthy and was had more steps than there needed to be. So I set out to revise it and make it short, sweet, and concise. I hope you learned something new or found this post interesting.
I am always open to ideas on how to improve myself so do not be afraid to critique my project in the comments.