Requirements

pip install pyqrcode  #<- Required for generating QR code
pip install qrtools   #<- Required for decoding QR code
sudo apt-get install libzbar-dev   #<- Required for zbar
pip install zbar   #<- Required for qrtools
pip install pillow   #<- Imaging library
pip install pypng  #<- for png generation

Generate QR Code

>>> import pyqrcode
>>> qr = pyqrcode.create("HORN O.K. PLEASE.")
>>> qr.png("horn.png", scale=6)

Decode QR Code

>>> import qrtools
>>> qr = qrtools.QR()
>>> qr.decode("horn.png")
>>> print qr.data
u'HORN O.K. PLEASE.'

Reference Link

Official Documentation for PyQRCode

results matching ""

    No results matching ""