Browse Source

Struct

pull/152/head
Jure Šorn 1 year ago
parent
commit
ae90a217ad
2 changed files with 2 additions and 0 deletions
  1. 1
      README.md
  2. 1
      index.html

1
README.md

@ -1988,6 +1988,7 @@ Struct
------
* **Module that performs conversions between a sequence of numbers and a bytes object.**
* **System’s type sizes, byte order, and alignment rules are used by default.**
* **The only exception being types float and double, that always take up 4 and 8 bytes.**
```python
from struct import pack, unpack

1
index.html

@ -1648,6 +1648,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
<div><h2 id="struct"><a href="#struct" name="struct">#</a>Struct</h2><ul>
<li><strong>Module that performs conversions between a sequence of numbers and a bytes object.</strong></li>
<li><strong>System’s type sizes, byte order, and alignment rules are used by default.</strong></li>
<li><strong>The only exception being types float and double, that always take up 4 and 8 bytes.</strong></li>
</ul><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> struct <span class="hljs-keyword">import</span> pack, unpack
&lt;bytes&gt; = pack(<span class="hljs-string">'&lt;format&gt;'</span>, &lt;el_1&gt; [, ...]) <span class="hljs-comment"># Packages arguments into bytes object.</span>
&lt;tuple&gt; = unpack(<span class="hljs-string">'&lt;format&gt;'</span>, &lt;bytes&gt;) <span class="hljs-comment"># Use iter_unpack() for iterator of tuples.</span>

Loading…
Cancel
Save