Python qrcode – Generating QR codes

In this post we will be creating a script in Python that will generate QR codes, to do this we will be using the qrcode module which generates QR code images. The module comes along with Pillow, which is a Python imaging library. This will enable us to save the QR codes as separate images outside of the script.

The full source code can be found below.

import qrcode

img = qrcode.make('scriptopia.co.uk')
type(img)  
img.save("qrcode.png")

This would output the following QR code.

QR Code for Scriptopia.co.uk

Leave a Reply