首页 > TAG信息列表 > enstr

python | 浅学 | 6 LookupError: 'base64' is not a text encoding; use codecs.encode() to handl

 你这样 import base64 str1 = "this is string example" print (str1) str1 = str1.encode(encoding ='utf-8',errors = 'strict') # 先转成bytes 的string print (str1) str2= base64.b64encode(str1) # 再使用base64.b64e