Binary Data Services二进制数据服务¶
The modules described in this chapter provide some basic services operations for manipulation of binary data. 本章描述的模块提供了一些用于操作二进制数据的基本服务操作。Other operations on binary data, specifically in relation to file formats and network protocols, are described in the relevant sections.有关二进制数据的其他操作,特别是与文件格式和网络协议相关的操作,将在相关章节中介绍。
Some libraries described under Text Processing Services also work with either ASCII-compatible binary formats (for example, 文本处理服务中描述的一些库还可以使用ASCII兼容的二进制格式(例如re
) or all binary data (for example, difflib
).re
)或所有二进制数据(例如difflib
)。
In addition, see the documentation for Python’s built-in binary data types in Binary Sequence Types — bytes, bytearray, memoryview.此外,请参阅二进制序列类型:bytes
、bytearray
、memoryview
中Python内置二进制数据类型的文档。
struct
—Interpret bytes as packed binary data将字节解释为压缩二进制数据codecs
—Codec registry and base classes编解码器注册表和基类Codec Base Classes编解码器基类Encodings and Unicode编码和UnicodeStandard Encodings标准编码Python Specific EncodingsPython特定编码encodings.idna
—Internationalized Domain Names in Applications应用程序中的国际化域名encodings.mbcs
—Windows ANSI codepageWindows ANSI代码页encodings.utf_8_sig
—UTF-8 codec with BOM signature具有BOM签名的UTF-8编解码器