上代码
filename = r"C:UsersAdministratorDesktopc548469207a406698b21b5abff923e8.jpg"import pyzbar.pyzbar as pyzbarfrom PIL import Imagedef zabr_parser(image): img = Image.open(image) img.show() barcodes = pyzbar.decode(img) print(barcodes) for barcode in barcodes: barcodeData = barcode.data.decode("utf-8") print(barcodeData)zabr_parser(filename)