概述
def convertFromBase64 (stringToBeDecoded):
import base64
decodedstring=str.decode('base64',"stringToBeDecoded")
print(decodedstring)
return
convertFromBase64(dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE=)
I am tying to take a base64 encoded string and convert it back to the original string but I cant figure out quite what is wrong
I am getting this error
Traceback (most recent call last):
File "C:/Python32/junk", line 6, in
convertFromBase64(("dGhpcyBpcyBzdHJpbmcgZXhhbXBsZS4uLi53b3chISE="))
File "C:/Python32/junk", line 3, in convertFromBase64
decodedstring=str.decode('base64',"stringToBeDecoded")
AttributeError: type object 'str' has no attribute 'decode'
解决方案
A string is already 'd
最后
以上就是魁梧香氛为你收集整理的python3转base64_如何从Base64转换为字符串Python 3.2的全部内容,希望文章能够帮你解决python3转base64_如何从Base64转换为字符串Python 3.2所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复