donate.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:open-synthesis 作者: twschiller 项目源码 文件源码
def make_qr_code(message, error_correction=qrcode.constants.ERROR_CORRECT_M, box_size=10, border=4):
    """Return an in-memory SVG QR code containing the given message."""
    # https://pypi.python.org/pypi/qrcode/5.3
    # qrcode.constants.ERROR_CORRECT_M means about 15% or less errors can be corrected.
    code = qrcode.QRCode(
        version=1,
        error_correction=error_correction,
        box_size=box_size,
        border=border,
    )
    code.add_data(message)
    code.make(fit=True)
    img = code.make_image(image_factory=SvgPathImage)
    raw = BytesIO()
    img.save(raw)
    raw.flush()
    return raw
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号