Python将图片转换为base64编码

Python将图片转换为base64编码

import base64


pic = open("1.png", "rb")
pic_base64 = base64.b64encode(pic.read())

print(pic_base64)

pic.close()

猜你喜欢

转载自blog.csdn.net/J__Max/article/details/82424551