赞
踩
windows 10 + Python 3.7.1
安装:
pip3 install myqr
安装好后,查看源码,进入myqr.py,找到run 函数,查看支持的字符集:
supported_chars = r"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ··,.:;+-*/\~!@#$%^&`'=<>[]()?_{}|"
可以看到是不支持中文的,输入中文就报错:
Wrong words! Make sure the characters are supported!
- from MyQR import myqr
- ver,level,qr_name = myqr.run(words="123")
- print(ver,level,qr_name)
qrcode.png:
手机扫二维码结果:
只需将上面的文字换成连接即可:
- from MyQR import myqr
- ver,level,qr_name = myqr.run(words="https://blog.csdn.net/qq_36853469/article/details/103973519")
- print(ver,level,qr_name)
qrcode.png:
- from MyQR import myqr
- ver,level,qr_name = myqr.run(words="https://blog.csdn.net/qq_36853469/article/details/103973519",picture="pkq.jpg",colorized=True)
- '''
- colorized=True 彩色二维码
- colorized=False 黑白二维码
- '''
- print(ver,level,qr_name)
qrcode.png:(彩色和黑白)
将图片换成动态图就行了
- ver,level,qr_name = myqr.run(words="https://blog.csdn.net/qq_36853469/article/details/103973519",picture="pkq.gif",colorized=True)
- print(ver,level,qr_name)
qrcode.png:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。