Founder & Programmer at HackersFriend Updated Jan. 3, 2020, 7:12 p.m. ⋅ 405 views

Generate QR Code using python with pyqrcode module

We can easily generate QR codes with python using pyqrcode module. It takes a string as input and generate QR code is expected format, having the string we gave as input. pyqrcode module follows standards of QR code.

Here is an implemetation of it.

Let's start by installing the pyqrcode module.

pip install pyqrcode

Here is sample code to generate QR code with www.hackersfriend.com as information in it.


# Import QRCode from pyqrcode 
import pyqrcode 
from pyqrcode import QRCode 

# String which represent the QR code 
s = "www.hackersfriend.com"

# Generate QR code 
url = pyqrcode.create(s) 

# Create and save the png file naming "hackersfriend.svg" 
url.svg("hackersfriend.svg", scale = 8)


Here is what is generates:

QR code of Hackersfriend

Go back to feed

HackersFriend Updates

View more


Nov. 28, 2018, 5:30 p.m.

Python from zero to hero

place Delhi

View details

Aug. 13, 2018, 5:30 p.m.

Python from zero to hero

place Bangalore ( HackersFriend office BTM Layout)

View details