Programming Script Text Coding Word
A QR code is a square barcode of 2 Dimensions that can be digitally and quickly read by smartphones. They are a convenient way to store all kinds of data in a small space. In this tutorial, you will learn how to generate and read QR codes in Python using qrcode in only 5 lines.
A QR code is a square barcode of 2 Dimensions that can be digitally and quickly read by smartphones. They are a convenient way to store all kinds of data in a small space. In this tutorial, you will learn how to generate and read QR codes in Python using qrcode
How do we use it?
- To send Simple texts.
- E-mail addresses: Just like texts, you can also send predefined emails.
- Phone Numbers: QR codes can also be used to call someone.
- Reveal discounts and coupon codes: You can be redirected to the online checkout with the promo code pre-applied if you don’t remember them.
- Connect to WiFi without password: You no longer need to share or remember passwords. Scan the QR code and join the WiFi network.
- Engage with social media(Like and Follow).
- Links to Download apps: You can now scan QR codes to download an app from the App Store.
How to generate it?
Step 1 : Installing Python.
https://www.python.org/downloads/release/python-382/
Step 2 : Test if Python Installed.
Step 3 : Installing Pillow
Pillow is Library that adds support for opening, manipulating, and saving many different image file formats.
pip is an already installed package-management system used to install and manage software packages written in Python.
Step 4 : Installing qrcode Module
Step 5 : Create QrcodeGenerator.py file
import qrcode # example data data = "https://hufnews.com" # output file name filename = "hufnews.png" # generate qr code img = qrcode.make(data) # save img to a file img.save(filename)
Step 6 : Generate QR Code image
and here’s the final result