python中进行base64编码和解码要用base64模块,代码示例:
#-*- coding: utf-8 -*-
import base64
str = ‘cnblogs’
str64 = base64.b64encode(str)
print str64 #y25ibg9ncw==
print base64.b64decode(str64) #cnblogs
A programmer’s note boke for work and life
python中进行base64编码和解码要用base64模块,代码示例:
#-*- coding: utf-8 -*-
import base64
str = ‘cnblogs’
str64 = base64.b64encode(str)
print str64 #y25ibg9ncw==
print base64.b64decode(str64) #cnblogs