base64的使用

Posted chenadong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了base64的使用相关的知识,希望对你有一定的参考价值。


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())

以上是关于base64的使用的主要内容,如果未能解决你的问题,请参考以下文章