← 返回卡片

原书出处

Python Cookbook(第3版)中文版

第3版中文版 · 核验版本的摘录快照 · 导入于 2026-11-14T02:34:04.716Z

决方案 base64模块中有两个函数——

b64encode()和b64decode()——它们正是我们所需要的。示例如下: >>> # Some byte data >>> s = b'hello' >>> import base64 >>> # Encode as Base64 >>> a = base64

.b64encode(s) >>> a

此预览只包含定位所需的摘录和上下文。

原书定位详情

来源:a19c7933-4eda-4176-aebd-30fe7e1ad292

正文位置:extracted/Python Cookbook(第3版)中文版/_epub-src/OEBPS/Text/part0012.xhtml

EPUB SHA-256:06e9310484dbd481a38263fd0ee26359bea9a3862a64cb4a53d4096b0f991e70