python 二维码脚本

参考:http://www.cnblogs.com/taceywong/p/5447556.html

对比分析python下识别二维码用法和识别率:http://www.php.cn/python-tutorials-373780.html

http://blog.csdn.net/shijichao2/article/details/51228408

https://www.tuicool.com/articles/eyaANrj

基本用法,能快速的满足基本需求:

import qrcode

img = qrcode.make('http://www.xgezhang.com/')

img.save('xgezhang.png')


python 二维码脚本_第1张图片


以下是用zbar识别的脚本

import zbar

from PIL import Image

scanner = zbar.ImageScanner()

scanner.parse_config('enable')

img = Image.open('./test.jpg').convert('L')

w, h = img.size

zimg = zbar.Image(w, h, 'Y800', img.tobytes())

scanner.scan(zimg)

for s in zimg:

print s.type, s.data

你可能感兴趣的:(python 二维码脚本)