# configure the reader scanner.parse_config('enable')
# obtain image data pil = Image.open(filename).convert('L') width, height = pil.size #pil.show() raw = pil.tostring()
# wrap image data image = zbar.Image(width, height, 'Y800', raw)
# scan the image for barcodes scanner.scan(image)
tmpdata='' # extract results for symbol in image: # do something useful with results print symbol.type, '图片内容为:/n%s' % symbol.data tmpdata=tmpdata+symbol.data
# clean up del(image) os.remove(filename) return tmpdata if __name__ == '__main__': url = '//www.VeVB.COm' qrRead(url)