该脚本局限性较大,需要文件夹内的二维码图片命名为整型
适合场景:二维码扫描结果为1或0,二维码数量庞大
import zxing import os filepath = r"文件夹路径" l = os.listdir(filepath) l.sort(key=lambda x:int(x[:-4])) t = '' for i in l: reader = zxing.BarCodeReader() barcode = reader.decode(filepath+"\\"+i) if(barcode.parsed == 'zero'): t = t + '0' else: t = t + '1' print(t)
标签:批量,filepath,扫描,zxing,二维码,reader,import From: https://www.cnblogs.com/willingyut/p/17658669.html