我第一次尝试运行zbarlight,我使用推荐的脚本。
from PIL import Image
import zbarlight
file_path = './tests/fixtures/two_qr_codes.png'
with open(file_path, 'rb') as image_file:
image = Image.open(image_file)
image.load()
codes = zbarlight.scan_codes('qrcode', image)
print('QR codes: %s' % codes)
请参阅下文
https://pypi.python.org/pypi/zbarlight/1.0.0
但是我收到以下错误
Traceback(最近一次调用最后一次):文件 “/Users/JamesParsons/Dropbox/Python/carpark.py”,第6行,in with open(file_path,'rb')as image_file:FileNotFoundError:[Errno 2]没有这样的文件或目录: './tests/fixtures/two_qr_codes.png'
解决此问题的最佳方法是什么?