码迷,mamicode.com
首页 > 编程语言 > 详细

python 生成二维码

时间:2018-08-24 18:10:53      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:actor   img   python   ext   令行   span   HERE   style   nbsp   

pip install qrcode (pip/pip3

pip install Image

命令行:

qr ‘http://www.ziqiangxuetang.com‘ > test.png

代码:

import qrcode

img = qrcode.make(‘http://www.tuweizhong.com‘)

with open(‘test.png‘, ‘wb‘) as f:

    img.save(f)

 

pip install git+git://github.com/ojii/pymaging.git#egg=pymaging

pip install git+git://github.com/ojii/pymaging-png.git#egg=pymaging-png

命令行:

qr --factory=pymaging "Some text" > test.png

代码:

import qrcode

from qrcode.image.pure import PymagingImage

img = qrcode.make(‘Some data here‘, image_factory=PymagingImage)

python 生成二维码

标签:actor   img   python   ext   令行   span   HERE   style   nbsp   

原文地址:https://www.cnblogs.com/tuijin/p/9531168.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!