python - Python如何检索数组中的数据
问题描述
首先我不确定这是否是一个数组。但这是 pyzbar 解码二维码图像
>>> from pyzbar.pyzbar import decode
>>> from PIL import Image
>>> barcode = decode(Image.open('qr111.png'))
>>> print(barcode)
[Decoded(data='812', type='QRCODE', rect=Rect(left=1166, top=306, width=336, height=336), polygon=[Point(x=1166, y=306), Point(x=1166, y=642), Point(x=1502, y=642), Point(x=1502, y=306)])]
我想专门检索数据的值“812”,我该怎么做?我试过 print(barcode[Decoded(data)]) 无济于事。
解决方案
推荐阅读
- node.js - 无法连接到 socket.io 服务器
- java-8 - 即使数据库实例关闭,CrudRepository 计数方法也会返回结果
- esp32 - 带有 esp32 的 Enc28j60 模块挂起
- curl - cURL NTLM 对 IIS8.5 的授权失败
- c# - 有没有办法在 bunit 测试中设置 OnAfterRender 方法的 firstRender-Variable?
- r - 使用 taskscheduleR 将任务计划程序设置为特定日期?
- c++ - 使用 struct 排队(出租车调度问题)
- forms - 如何使用绑定文本创建完全可定制的部分?
- java - 从 nginx 代理到 Chrome 中的 java 应用程序时缺少 cookie
- google-apps-script - Ranges 中的值(按命名范围)到变量