二维码简介
qrcode是二维码的一种,可以包含几千个字符。
qrcode使用
|
|
安装完之后,可以使用命令行工具:
|
|
也可以在python中使用qrcode
模块:
|
|
使用 QRCode类
|
|
version
数值从1到40,表示生成二维码的大小
error_correction
parameter controls the error correction used for the QR Code. The following four constants are made available on the qrcode
package:
ERROR_CORRECT_L
About 7% or less errors can be corrected.
ERROR_CORRECT_M
(default) About 15% or less errors can be corrected.
ERROR_CORRECT_Q
About 25% or less errors can be corrected.ERROR_CORRECT_H
About 30% or less errors can be corrected.
box_size
parameter controls how many pixels each “box” of the QR code is.
border
parameter controls how many boxes thick the border should be (the default is 4, which is the minimum according to the specs).
This module uses image libraries, Python Imaging Library (PIL) by default, to generate QR Codes.
It is recommended to use the pillow fork rather than PIL itself.
Pilow和PIL不兼容,默认是PIL,当你安装Pillow之后就会卸载PIL