<array> = array(<spanclass="hljs-string">'<typecode>'</span>, <array>) <spanclass="hljs-comment"># Treats array as a sequence of numbers.</span>
<array>.fromfile(<file>, n_items) <spanclass="hljs-comment"># Appends items from the binary file.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><bytes> = bytes(<array>) <spanclass="hljs-comment"># Converts array to a bytes object.</span>
<pre><codeclass="python language-python hljs"><bytes> = bytes(<array>) <spanclass="hljs-comment"># Returns a copy of array's memory.</span>
<file>.write(<array>) <spanclass="hljs-comment"># Writes array to the binary file.</span>
</code></pre>
<div><h2id="memoryview"><ahref="#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><codeclass="python language-python hljs"><mview> = memoryview(<bytes/bytearray/array>) <spanclass="hljs-comment"># Immutable if bytes, else mutable.</span>