识别二维码
安装
pip install pyzbar
实现
#-*- coding: utf-8 -*-
from pyzbar.pyzbar import decode
from PIL import Image
image = 'test.png'
img = Image.open(image)
barcodes = decode(img)
for barcode in barcodes:
url = barcode.data.decode("utf-8")
print(url)
参考
python 识别二维码内容的方法