Coders Packet

PYTHON QR (Quick Response) Code Generator

By Krishna Prasad Deekonda

This packet gives us an idea of how to generate QR code in Python for given data/information such as URLs

Modules used:

*qrcode

*image

Description/Functionality:

First of all we need to make sure that our Python IDE has pip installed in it if not installed download get-pip.py file from the web in the same directory as Python is installed and then we can install required modules in our IDE Terminal as in this case using

                       pip install qrcode

                       pip install image   commands

once the  modules are installed we can import them into our code and supply info/data for which we generate QR Code

Source Code:

import qrcode
import image
QR = qrcode.QRCode(
    version = 15,
    box_size = 8,
    border = 7
)
web_site = "https://www.swipebuz.blogspot.com/"
QR.add_data(web_site)
QR.make(fit = True)
img = QR.make_image(fill = "black", back_color = "white")
img.save("WEBSITE_QRCODE.jpg")

Here in the code I have Provided URL for my Personal Blog and you can customise it as per your requirement

Generated QR:

On running this Code in our IDE QR_CODE Image (.jpg format)is saved in the same directory in which the python file is saved

Download project

Reviews Report

Submitted by Krishna Prasad Deekonda (krishnadeekonda)

Download packets of source code on Coders Packet