Browse Source

Struct

pull/152/head
Jure Šorn 1 year ago
parent
commit
9cbf369bbc
2 changed files with 4 additions and 6 deletions
  1. 3
      README.md
  2. 7
      index.html

3
README.md

@ -1988,11 +1988,10 @@ 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
<bytes> = pack('<format>', <el_1> [, ...]) # Packages arguments into bytes object.
<bytes> = pack('<format>', <el_1> [, ...]) # Packages arguments or raises struct.error.
<tuple> = unpack('<format>', <bytes>) # Use iter_unpack() for iterator of tuples.
```

7
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>January 27, 2023</aside>
<aside>January 28, 2023</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -1648,9 +1648,8 @@ 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;bytes&gt; = pack(<span class="hljs-string">'&lt;format&gt;'</span>, &lt;el_1&gt; [, ...]) <span class="hljs-comment"># Packages arguments or raises struct.error.</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>
</code></pre></div>
@ -2924,7 +2923,7 @@ $ pyinstaller script.py --add-data '&lt;path&gt;:.' <span class="hljs-comment">
<footer>
<aside>January 27, 2023</aside>
<aside>January 28, 2023</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Loading…
Cancel
Save