uTools-Manuals/docs/python/binary.html
2019-04-08 23:22:26 +08:00

1 line
6.6 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="body" role="main"><div class="section" id="binary-data-services"><h1><span class="yiyi-st" id="yiyi-9">7.</span><span class="yiyi-st" id="yiyi-10">二进制数据服务</span></h1><p><span class="yiyi-st" id="yiyi-11">本章中描述的模块提供了一些用于操纵二进制数据的基本服务操作。</span><span class="yiyi-st" id="yiyi-12">二进制数据的其他操作,特别是与文件格式和网络协议有关的操作,将在相关章节中介绍。</span></p><p><span class="yiyi-st" id="yiyi-13"><a class="reference internal" href="text.html#textservices"><span>文本处理服务</span></a>下描述的某些库也可以与ASCII兼容的二进制格式例如<a class="reference internal" href="re.html#module-re" title="re: Regular expression operations."><code class="xref py py-mod docutils literal"><span class="pre">re</span></code></a>)或所有二进制数据(例如<a class="reference internal" href="difflib.html#module-difflib" title="difflib: Helpers for computing differences between objects."><code class="xref py py-mod docutils literal"><span class="pre">difflib</span></code></a>)。</span></p><p><span class="yiyi-st" id="yiyi-14">此外,请参阅<a class="reference internal" href="stdtypes.html#binaryseq"><span>Binary Sequence Types — bytes, bytearray, memoryview</span></a>中Python内建二进制数据类型的文档。</span></p><div class="toctree-wrapper compound"><ul><li class="toctree-l1"><span class="yiyi-st" id="yiyi-21"><a class="reference internal" href="struct.html">7.1. <code class="docutils literal"><span class="pre">struct</span></code> - 将字节解释为打包二进制数据</a></span><ul><li class="toctree-l2"><span class="yiyi-st" id="yiyi-15"><a class="reference internal" href="struct.html#functions-and-exceptions">7.1.1.函数和异常</a></span></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-19"><a class="reference internal" href="struct.html#format-strings">7.1.2.格式字符串</a></span><ul><li class="toctree-l3"><span class="yiyi-st" id="yiyi-16"><a class="reference internal" href="struct.html#byte-order-size-and-alignment">7.1.2.1.字节顺序,大小和对齐</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-17"><a class="reference internal" href="struct.html#format-characters">7.1.2.2.格式字符</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-18"><a class="reference internal" href="struct.html#examples">7.1.2.3.示例</a></span></li></ul></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-20"><a class="reference internal" href="struct.html#classes">7.1.3.类</a></span></li></ul></li><li class="toctree-l1"><span class="yiyi-st" id="yiyi-42"><a class="reference internal" href="codecs.html">7.2. <code class="docutils literal"><span class="pre">codecs</span></code> - Codec注册表和基类</a></span><ul><li class="toctree-l2"><span class="yiyi-st" id="yiyi-32"><a class="reference internal" href="codecs.html#codec-base-classes"> 7.2.1. 编解码器基类</a></span><ul><li class="toctree-l3"><span class="yiyi-st" id="yiyi-22"><a class="reference internal" href="codecs.html#error-handlers">7.2.1.1.错误处理程序</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-23"><a class="reference internal" href="codecs.html#stateless-encoding-and-decoding">7.2.1.2.无状态编码和解码</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-26"><a class="reference internal" href="codecs.html#incremental-encoding-and-decoding">7.2.1.3.增量编码和解码</a></span><ul><li class="toctree-l4"><span class="yiyi-st" id="yiyi-24"><a class="reference internal" href="codecs.html#incrementalencoder-objects"> 7.2.1.3.1. IncrementalEncoder对象</a></span></li><li class="toctree-l4"><span class="yiyi-st" id="yiyi-25"><a class="reference internal" href="codecs.html#incrementaldecoder-objects"> 7.2.1.3.2. IncrementalDecoder对象</a></span></li></ul></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-31"><a class="reference internal" href="codecs.html#stream-encoding-and-decoding">7.2.1.4.流编码和解码</a></span><ul><li class="toctree-l4"><span class="yiyi-st" id="yiyi-27"><a class="reference internal" href="codecs.html#streamwriter-objects">7.2.1.4.1. StreamWriter对象</a></span></li><li class="toctree-l4"><span class="yiyi-st" id="yiyi-28"><a class="reference internal" href="codecs.html#streamreader-objects"> 7.2.1.4.2. StreamReader对象</a></span></li><li class="toctree-l4"><span class="yiyi-st" id="yiyi-29"><a class="reference internal" href="codecs.html#streamreaderwriter-objects"> 7.2.1.4.3. StreamReaderWriter对象</a></span></li><li class="toctree-l4"><span class="yiyi-st" id="yiyi-30"><a class="reference internal" href="codecs.html#streamrecoder-objects"> 7.2.1.4.4. StreamRecoder对象</a></span></li></ul></li></ul></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-33"><a class="reference internal" href="codecs.html#encodings-and-unicode">7.2.2. Encoding和Unicode</a></span></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-34"><a class="reference internal" href="codecs.html#standard-encodings">7.2.3.标准编码</a></span></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-38"><a class="reference internal" href="codecs.html#python-specific-encodings">7.2.4. Python特定编码</a></span><ul><li class="toctree-l3"><span class="yiyi-st" id="yiyi-35"><a class="reference internal" href="codecs.html#text-encodings">7.2.4.1.文本编码</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-36"><a class="reference internal" href="codecs.html#binary-transforms">7.2.4.2.二进制变换</a></span></li><li class="toctree-l3"><span class="yiyi-st" id="yiyi-37"><a class="reference internal" href="codecs.html#text-transforms">7.2.4.3.文本转换</a></span></li></ul></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-39"><a class="reference internal" href="codecs.html#module-encodings.idna">7.2.5. <code class="docutils literal"><span class="pre">encodings.idna</span></code> - 应用程序中的国际化域名</a></span></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-40"><a class="reference internal" href="codecs.html#module-encodings.mbcs">7.2.6. <code class="docutils literal"><span class="pre">encodings.mbcs</span></code> - Windows ANSI代码页</a></span></li><li class="toctree-l2"><span class="yiyi-st" id="yiyi-41"><a class="reference internal" href="codecs.html#module-encodings.utf_8_sig">7.2.7. <code class="docutils literal"><span class="pre">encodings.utf_8_sig</span></code> - 具有BOM声音的UTF-8编解码器</a></span></li></ul></li></ul></div></div></div>