格式,传到后端django,但pillow是无法直接读取base64格式的图片的,所以特地查阅了一些资料,发现python3内置了base64转换函数,这里分享一下使用方法...
import os,.../robot.png", "rb") as f:
# 将读取的二进制文件转换为base64字符串
bs64_str = base64.b64encode(f.read())
#...打印图像转换base64格式的字符串,type结果为
print(bs64_str, type(bs64_str))
# 将base64格式的数据装换为二进制数据...18岁的,我还差15年呢!"....encode("utf-8"))
print("bs64格式的文本(伪加密)",bs64_my_time)
my_time = base64.b64decode(bs64_my_time).decode