用Python生成二维码

最近有生成二维码的需求, 发现了MyQr这个项目,

https://github.com/sylnsfar/qrcode/blob/master/README-cn.md


 pip install myqr

安装


然后用法为:


from MyQR import myqr
import os


version, level, qr_name = myqr.run(
    'https://item.taobao.com/item.htm?id=521610412486',
    version = 1,
    level = 'H',
    picture = None,
    colorized = False,
    contrast = 1.0,
    brightness = 1.0,
    save_name = '521610412486_qr.png',
    save_dir = os.getcwd()


)


生成的图片用手机淘宝扫描通过。


你可能感兴趣的:(python,qrcode,python,二维码,qrcode)