Creating and Saving QR Codes
In this tutorial we will talk about creating QR codes
and Saving QR codes
most of the things we will be going over should be simple but you should have a simple and basic understanding of computer programming to achieve what is wanted in this tutorial.
Words of wisdom: Use the tools at your disposal and keep being persistent to make sure you get it right.
Supplies
A computer and an internet connection and some intermediate coder experience.
Go on to Www.python.org and Download the Python Interpreter
First, go to www.python.org and chose download. Then chose the correct download for your system(E.X. chose mac if you're on a mac). Then after looking at the versions of python available for download chose 3.7 and click download installer. After that open up the package installer and when getting to the stage of installation click customize and make sure that all the customization boxes are checked off.
Download PyCharm at Www.jetbrains.com
First go to www.jetbrains.com and click on developer tools. you will find a number of tools there including one called PyCharm, download it and put it in your applications folder if your on Mac.
Open Pycharm and Get the Editor Setup
Open up the PyCharm editor and start a new project. make sure that when starting this new project that in the interpreter section python 3.7 is chosen. To make sure of this when your project is loading, look at the bottom right corner to see if it says 3.7 is set as interpreter.
Check to See If Pip Installed
Because of downloading the 3.7 interpreter, it should have already installed pip. However, this also may not have happened as there are certain parameters that cant be filled. So it's important to check and see if it's installed. If you're on Mac as I am, open up your terminal window and type 'pip --version'. if this comes up with an error message then pip is not installed and you'll need to go to the following link to see other ways of installation. if it does tell you a long message giving you the version you're running. Congrats because this step(possibly and most stupidly the hardest step) is now satisfied.
extra help
Creating QR Codes
To create QR codes we firstly need to pip install libraries and extensions to our code editor. So first we need to go to our Terminal window and type in 'pip install image' and 'pip install qrcode'. do not use spaces when typing in QR code as it will pop up as incorrect. Then once we've done that we need to import the two new packages to our editor. once we've done that we just need to type in 4 lines of code that are held within the picture. and then we can unjustly start making QR codes.
-The data variable will of course hold the info we want on the QR code.
-The Name variable will hold the name of the QR code image
-Then using the image function. We can create the actual file of the QR code that has the data on it.
Storying History of QR Codes
To store the data on our codes and to save the filenames with those codes we can create a simple text database. Luckily for us, this doesn't require pip installing anything and is built right into python. First, we have to create a variable that will hold our database's beginnings and settings. the settings of the file can be changed later but it's important to give the setting a plus symbol so that if the file hasn't been created already it will be created automatically. then we can easily just write the code held in the picture to write down the variables that have already been declared to create the QR code. It's important to note the '/n' at the end of the line of code as it will make sure there are no spacing errors between codes and start history on new lines.
-The declaration of the op variable is our text file settings and the name. it will be given upon creation. we also call the variable op(short for open). so this way it's easy to access when writing commands
-We use our op variable to write the data and filename to the file for storage.