python3 the string base64 transcoding

Import Base64 
# b64encode base64 used in () for transcoding, after transcoding with 'utf-8' decoding
# s string to be transcoded
res = base64.b64encode (s.encode ( "utf -8")). decode ( 'utf-8')

Guess you like

Origin www.cnblogs.com/fengpinglangjing/p/12017649.html