标签:read test write encode decode code base64 open jpg
import base64
with open("test.jpg", "rb") as f:
file = f.read()
file_base64 = base64.b64encode(file)
with open("test.txt", "w") as f_1:
f_1.write(file_base64.decode())
标签:read test write encode decode code base64 open jpg
原文地址:https://www.cnblogs.com/chenadong/p/10940221.html