Browse Source

Memory view

pull/44/head
Jure Šorn 5 years ago
parent
commit
211630594c
2 changed files with 3 additions and 3 deletions
  1. 2
      README.md
  2. 4
      index.html

2
README.md

@ -1964,10 +1964,10 @@ Memory View
<bin_file>.write(<mview>) # Writes mview to a binary file.
<bytes> = bytes(<mview>) # Creates a new bytes object.
<bytes> = <bytes>.join(<coll_of_mviews>) # Joins mviews using bytes object as sep.
<list> = list(<mview>) # Returns list of ints or floats.
```
```python
<list> = list(<mview>) # Returns list of ints or floats.
<str> = str(<mview>, 'utf-8')
<int> = int.from_bytes(<mview>, byteorder='big|little', signed=False)
'<hex>' = <mview>.hex()

4
index.html

@ -1744,9 +1744,9 @@ db = connector.connect(host=&lt;str&gt;, user=&lt;str&gt;, password=&lt;str&gt;,
<pre><code class="python language-python hljs">&lt;bin_file&gt;.write(&lt;mview&gt;) <span class="hljs-comment"># Writes mview to a binary file.</span>
&lt;bytes&gt; = bytes(&lt;mview&gt;) <span class="hljs-comment"># Creates a new bytes object.</span>
&lt;bytes&gt; = &lt;bytes&gt;.join(&lt;coll_of_mviews&gt;) <span class="hljs-comment"># Joins mviews using bytes object as sep.</span>
&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns list of ints or floats.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;list&gt; = list(&lt;mview&gt;) <span class="hljs-comment"># Returns list of ints or floats.</span>
&lt;str&gt; = str(&lt;mview&gt;, <span class="hljs-string">'utf-8'</span>)
<pre><code class="python language-python hljs">&lt;str&gt; = str(&lt;mview&gt;, <span class="hljs-string">'utf-8'</span>)
&lt;int&gt; = int.from_bytes(&lt;mview&gt;, byteorder=<span class="hljs-string">'big|little'</span>, signed=<span class="hljs-keyword">False</span>)
<span class="hljs-string">'&lt;hex&gt;'</span> = &lt;mview&gt;.hex()
</code></pre>

Loading…
Cancel
Save