在 pyzbar (通过它解析图片中的条形码) 里,
from pyzbar.pyzbar import (decode, Decoded)
from PIL import Image
decode(Image.open("Image"))
[Decoded(data='', type='',rect=Rect())]
在这里中,
Decoded 为
Results of reading a barcode
Decoded = namedtuple('Decoded', ['data', 'type', 'rect'])
这样的namedtuple
我想把 decode 后出来的 'data' 这个部分的字段拿出来继续用,
试过
Decoded.data
结果 = property object at xxxxxxx
试过
result = decode(Image.open("Image"))
result.data
结果 = AttributeError : 'list' object has no attribute 'data'
求帮忙。。