DEV Community

Cover image for QR Code Generator and Reader in Python
Arpit
Arpit

Posted on • Edited on

3 1

QR Code Generator and Reader in Python

QR code generator

import pyqrcode 
import png 
from PIL import Image 

s = "https://www.codesnail.com" 
url = pyqrcode.create(s) 

img = "codesnail-qr-code.png" 
url.png(img, scale=10) 

#opening image 
im=Image.open(img) 
im.show() 
Enter fullscreen mode Exit fullscreen mode

for installation guide: click me

QR code reader

from pyzbar.pyzbar import decode 
from PIL import Image 

d = decode(Image.open("codesnail-qr-code.png")) 
# print(d) 
print(d[0].data.decode()) 
Enter fullscreen mode Exit fullscreen mode

for installation guide: click me

Happy coding :)

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more