python将图片转为base64编码时间:2020-12-29 03:25:43 import base64 f = open("m1.jpg", "rb") res = f.read() s = base64.b64encode(res) f = open("hello.txt","w") f.write(s)