import base64
with open('./aa.jpg', 'rb') as f:
qrcode = base64.b64encode(f.read()).decode()
"""
#The following is wrong, when json.dumps is run, i
在python3中将jpg转成base64并写入json
最新推荐文章于 2024-08-17 14:15:26 发布
import base64
with open('./aa.jpg', 'rb') as f:
qrcode = base64.b64encode(f.read()).decode()
"""
#The following is wrong, when json.dumps is run, i