1.选好一张好看的图片,掏出我压箱底的美图,如图
2.保存在同目录为1.jpg
3.下载myqr库
使用命令 pip install myqr
4.生成的图片保存格式需要png形式
5.最后完整代码展示
from MyQR import myqr
import os
text='https://imoemei.com/'
myqr.run(text,#words必须要有,其他参数都有默认值,根据需求来
version=1,
level='H',
picture='1.jpg',
colorized=True,
contrast=1.0,
brightness=1.0,
save_name='timg2.png',#注意只能生成png图片
save_dir=os.getcwd()) #save_dir: str, the output directory
6.生成的二维码展示
跑通的兄弟们
记得给我一键三连!!!