Browse Source

Array

pull/187/head
Jure Šorn 6 months ago
parent
commit
2f3952a3b6
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -2048,7 +2048,7 @@ from array import array
```
```python
<bytes> = bytes(<array>) # Converts array to a bytes object.
<bytes> = bytes(<array>) # Returns a copy of array's memory.
<file>.write(<array>) # Writes array to the binary file.
```

2
index.html

@ -1693,7 +1693,7 @@ CompletedProcess(args=[<span class="hljs-string">'bc'</span>, <span class="hljs-
&lt;array&gt; = array(<span class="hljs-string">'&lt;typecode&gt;'</span>, &lt;array&gt;) <span class="hljs-comment"># Treats array as a sequence of numbers.</span>
&lt;array&gt;.fromfile(&lt;file&gt;, n_items) <span class="hljs-comment"># Appends items from the binary file.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;bytes&gt; = bytes(&lt;array&gt;) <span class="hljs-comment"># Converts array to a bytes object.</span>
<pre><code class="python language-python hljs">&lt;bytes&gt; = bytes(&lt;array&gt;) <span class="hljs-comment"># Returns a copy of array's memory.</span>
&lt;file&gt;.write(&lt;array&gt;) <span class="hljs-comment"># Writes array to the binary file.</span>
</code></pre>
<div><h2 id="memoryview"><a href="#memoryview" name="memoryview">#</a>Memory View</h2><p><strong>A sequence object that points to the memory of another bytes-like object. Each element can reference a single or multiple consecutive bytes, depending on format. Order and number of elements can be changed with slicing.</strong></p><pre><code class="python language-python hljs">&lt;mview&gt; = memoryview(&lt;bytes/bytearray/array&gt;) <span class="hljs-comment"># Immutable if bytes, else mutable.</span>

Loading…
Cancel
Save