import base64
# 示例字符串
encoded_string = "SGVsbG8sIFdvcmxkIQ=="
# 使用base64解码
decoded_bytes = base64.b64decode(encoded_string)
decoded_string = decoded_bytes.decode('utf-8')
print(f"解码后的字符串: {decoded_string}")
base64 模块,该模块提供了对 Base64 编码和解码的支持。encoded_string。base64.b64decode() 函数将 Base64 编码的字符串解码为字节对象。.decode('utf-8') 将字节对象转换为普通的字符串。如果你需要进一步的帮助或有其他问题,请告诉我!
上一篇:zip在python中的含义
下一篇:python 三目运算符
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站