Skip to content

Instantly share code, notes, and snippets.

@nenodias
Created April 5, 2025 18:11
Show Gist options
  • Save nenodias/f2d1a82064d48791f10c2e4d53d61061 to your computer and use it in GitHub Desktop.
Save nenodias/f2d1a82064d48791f10c2e4d53d61061 to your computer and use it in GitHub Desktop.
Python QRCode

You must install python dependencies

sudo apt-get install python-qrtools

The create.py is creating a qrcode with data "HORN O.K. PLEASE."

The read.py is reading an image with a qrcode and showing its data

import pyqrcode
qr = pyqrcode.create("HORN O.K. PLEASE.")
qr.png("horn.png", scale=6)
from PIL import Image
from pyzbar.pyzbar import decode
data = decode(Image.open('horn.png'))
print(data[0].data)
pyqrcode
pypng
pyzbar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment