Kinsa | Pixels + Logic Blog

Generate a QR Code with Python

Install the Pillow and QRCode packages

$ pip install pillow qrcode

Then, in a Python script:

import qrcode

img = qrcode.make('http://foo.bar')
img.save('/abs/path/to/file.png')

Or, even better, straight out of the docs, from the command line, run:

$ qr "Some text" > test.png

Feedback?

Email us at enquiries@kinsa.cc.

Found this useful?

We always appreciate a pint!