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内容请搜索靠谱客的其他文章。
发表评论 取消回复