Generate your QRCODE using PYqrcode Library in Python
I went to a event last week where I saw a fellow attendee was asked to share his Twitter id and what he did was something I never saw before, he just showed his qr code and told the other person to scan and follow. That is so cool right.
I went home and wanted to do same, so here is the code which can help you too create your own QR Code for easy access of important links. But before that scan my qrcode to follow me on linkedin 😋
Let us understand how the QRCode is created:-
- Install the PYQR library
pip install pyqrcode
2. Import the functions from the library
# Import QRCode from pyqrcode
import pyqrcode
import png
from pyqrcode import QRCode
3. Declare the links/data which you want to have in your qrcode
# backend of QR code
data = "https://www.linkedin.com/in/gauri-guglani-a87b731a6/"
4. Generate the QR code and save it
# Generate QR code
url = pyqrcode.create(data)
# Create and save the svg file naming "myqr.svg"
url.svg("ggqr.svg", scale = 8)
# Create and save the png file naming "myqr.png"
url.png('ggqr.png', scale = 6)
I have saved it in both the format svg and png, you can choose any one and save your qr code.
Hope you like this article and if you face any difficulties scan the above qr code and ping me on linkedin 😉