In this class, you'll learn how to generate QR Code using python.
- Python Basics
- QR Code Basics
- pyqrcode module
Introduction QR is short for Quick Response. A QR code is a type of matrix barcode first designed in 1994 for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached.
While QR Codes and Barcodes are similar in practice, QR Codes contain more information because they have the ability to hold information both horizontally and vertically.
Barcodes only use horizontal information.
A Static QR Code contains information that is fixed and uneditable once the Code has been generated.
Usecases:
- QR Codes in business cards or product packaging
- QR Codes for personal use like a party invitation
- QR Codes for Gyms
Dynamic QR Codes allow you to update, edit and modify the type of the QR Code however many times you need i.e. the content is editable.
Usecases:
- QR Codes for Coupons
- QR Codes for Social media
Open your Prompt
and type and run the following command (individually):
-
pip install pyqrcode
-
pip install pypng
pyqrcode
module is used to create QR Codes. It is designed to be as simple and as possible. It does this by using sane defaults and autodetection to make creating a QR Code very simple.
Once Installed now we can import it inside our python code.
You can and
Starring and Forking is free for you, but it tells me and other people that it was helpful and you like this tutorial.
Go here
if you aren't here already and click ➞ ✰ Star
and ⵖ Fork
button in the top right corner. You will be asked to create a GitHub account if you don't already have one.
-
Go
here
and click the big green ➞Code
button in the top right of the page, then click ➞Download ZIP
. -
Extract the ZIP and open it. Unfortunately I don't have any more specific instructions because how exactly this is done depends on which operating system you run.
-
Launch ipython notebook from the folder which contains the notebooks. Open each one of them
Kernel > Restart & Clear Output
This will clear all the outputs and now you can understand each statement and learn interactively.
If you have git and you know how to use it, you can also clone the repository instead of downloading a zip and extracting it. An advantage with doing it this way is that you don't need to download the whole tutorial again to get the latest version of it, all you need to do is to pull with git and run ipython notebook again.
I'm Dr. Milaan Parmar and I have written this tutorial. If you think you can add/correct/edit and enhance this tutorial you are most welcome🙏
See github's contributors page for details.
If you have trouble with this tutorial please tell me about it by Create an issue on GitHub. and I'll make this tutorial better. This is probably the best choice if you had trouble following the tutorial, and something in it should be explained better. You will be asked to create a GitHub account if you don't already have one.
If you like this tutorial, please give it a ⭐ star.
You may use this tutorial freely at your own risk. See LICENSE.
Copyright (c) 2020 Dr. Milaan Parmar