lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.34k stars 664 forks source link

Convert data to bytes automatically after use .add_data? #260

Open water5 opened 2 years ago

water5 commented 2 years ago
import qrcode
qr = qrcode.QRCode(version = 1, error_correction = qrcode.constants.ERROR_CORRECT_L, box_size = 10, border = 4,)
qr.add_data('abc')
qr.data_list

[b'abc']

img = qr.make_image(fill_color="black", back_color="white")

And then decode the QRcode image, the result text is b'abc', not the original, is it normal?

That will generate different QRcode image with below method:

qrcode.make('abc').show()