python3对字符串进行base64转码

import base64
# 使用base64的b64encode()进行转码,转码之后在用‘utf-8’解码
# s 要转码的字符串
res = base64.b64encode(s.encode("utf-8")).decode('utf-8')

猜你喜欢

转载自www.cnblogs.com/fengpinglangjing/p/12017649.html