python - 将 django python 中的二维码保存为 to_artistic 方法的 base64
问题描述
我想从 to_artistic 方法中保存我的二维码。
对于我一直在做的其他二维码:
buffer = io.BytesIO()
qr_img.save(buffer, format="PNG")
qr_code = "data:image/png;base64,"+base64.b64encode(buffer.getvalue()).decode("utf-8")
我怎样才能为 qr.to_artistic 做到这一点?文档:https ://segno.readthedocs.io/en/latest/web-development.html
谢谢!
解决方案
推荐阅读
- python - 给定一个包含 X 个浮点数的列表,返回中间 3 个浮点数的平均值和该列表的最低浮点数的元组
- linux - 如何编辑 .gitignore 文件
- drawing - 用于画线模式的 MT4 键盘快捷键
- sql - 如何使用 SQL 中的存储过程制作星形三角形?
- mysql - mysql 在字段中重复值,插入具有新值的新行
- python - *(Tensors 张量的元组,名称 dim,Tensor out)
- amazon-web-services - 在放大删除命令后重新创建 AWS 放大应用程序
- scala - 类型参数子句中的广义约束?
- html - 我怎样才能把第二张图片和按钮(下面)对齐?
- javascript - 尝试在经过一段时间后在 p5.js 中更改数组中椭圆的颜色,但出现错误:“TypeError:颜色不是函数”