Generate Qr-Code using Python
Qr codes are very useful in the current era. It's very helpful for payments, Websites, Scanning, and Advertisements.
Python offers a QRCode package which makes it really easy to implement this functionality. We will begin by downloading the following python packages.
So in this article, I would be helping you out with learning how to create a Python program to make your Qr- Code.
Preview:
This Qr-code was generated using Python for our Website. |
Python offers a QRCode package which makes it really easy to implement this functionality. We will begin by downloading the following python packages.
So, first of all, we would install the required libraries.
1. pyqrcode~ create the Qr-code.
2. png~ to convert it into a png image file.
pip install pillow
pip install qrcode
We will create a QRCode that will store a link to this article.
Now, let us take a look at how simple it is to implement it.
Code:
#import required libraries
import pyqrcode
import png
from pyqrcode import QRCode
Qrstring="https://codestarshub.blogspot.com/2020/12/generate-qr-code-using-python.html" #variable to store our link
url=pyqrcode.create(Qrstring)#function to create the qr-code
url.png('C:/Users/hp/Desktop/qr.png',scale=8)#create and save the png file at the location
In conclusion, we looked at how we can convert a text value into its equivalent QR Code. Perhaps you can create a QR Code for your own website URL or LinkedIn profile and include it in your business card or your Resume. Cheers!
Feel free to ask your question(s) in the comment, and I'll be happy to respond. All the best!
__________________________________________
People are also reading:
Written By:
Shubham Sagar,
Code Star
E-mail: sk0374391@gmail.com
A must needed post! This post is very useful for my business
ReplyDeleteWow 😳😳😳😳😳😳
ReplyDelete