Menu
QR Code Decoder
Decode QR-Code using Python
- We decode QR-Code very easily.
- We need two packeges to decode the QR.
We need two packeges, let's install at first
pip install pyzbar
also install
pip install pillow
we use pyzbar for decode QR-Code and pillow to allow opening images
At first we make a simple QR
Insia directory let we have a QR-Code png myqr.png
myqr.png
In this directory we make a python code and decode the QR-Code.
from pyzbar.pyzbar import decode
from PIL import Image
decoded = decode(Image.open("myqr.png"))
print(decoded[0].data.decode("ascii"))
After running this code we get the data from this a QR png
We successfully decode the QRCode
No comments yet. Be the first to comment!