我是靠谱客的博主 魁梧香氛,这篇文章主要介绍python3转base64_如何从Base64转换为字符串Python 3.2,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部