willsonlincake 发表于 2022-4-7 11:38:29

Python实现二维码扫码

https://github.com/Polyconseil/zbarlight
from PIL import Image
import zbarlight

file_path = './tests/fixtures/two_qr_codes.png'
with open(file_path, 'rb') as image_file:
    image = Image.open(image_file)
    image.load()

codes = zbarlight.scan_codes(['qrcode'], image)
print('QR codes: %s' % codes)
页: [1]
查看完整版本: Python实现二维码扫码