赞
踩
- import pyzbar
- from PIL import Image
-
- reader = zxing.BarCodeReader()
-
- bar = reader.decode("./恐龙锅00001.jpg")
- print(bar.parsed)
- 打印的内容: 'http://pay.g-hi.com/pay/wx/WxCustomer/supermarket?family_server_id=50014ee2b30ff5411010000199&from_place=app'
如果想批量解码,我们可以使用while来循环
- import pyzbar
- from PIL import Image
- imort os
-
- reader = zxing.BarCodeReader()
-
- for item in os.listdir():
- if item.find(.D)<=0:
- continue
- bar = reader.decode(item)
- print(bar.parsed)
- 打印的内容: 'http://pay.g-hi.com/pay/wx/WxCustomer/supermarket?family_server_id=50014ee2b30ff5411010000199&from_place=app'
我们的二维码都在一个文件夹里面
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。