r/Python • • Jul 11 '21

Tutorial QR Code In 4 lines of Python Code (Create / Read)

https://pysnakeblog.blogspot.com/2021/07/qr-code-in-4-lines-of-python-code.html
0 Upvotes

5 comments sorted by

5

u/SmoothieEnjoyer Jul 11 '21

or if you hate yourself:

import pyqrcode, png
pyqrcode.create("url").png("qr.png", scale=30)

20

u/Feb2020Acc Jul 11 '21

Tutorial on how to import libraries and call methods.

1

u/[deleted] Jul 12 '21

😂😂😂😂😂

2

u/pyEuler Jul 12 '21 edited Jul 12 '21

U can also use qrtools to decode.

To code:

#png is already include in pyqrcode

import pyqrcode pyqrcode.create("text").png("QRcode.png", scale = 5)

To decode:

#installed by apt-get install python-qrtools or pip install qrtools

import qrtools 
qr = qrtools.QR() 
qr.decode("QRcode.png") 
print(qr.data)