Browse Source

Exceptions, progress bar and index

pull/83/head
Jure Šorn 4 years ago
parent
commit
e2b3bb2b9e
5 changed files with 32 additions and 30 deletions
  1. 8
      README.md
  2. 7
      index.html
  3. 7
      parse.js
  4. 23
      pdf/index_for_pdf.html
  5. 17
      pdf/index_for_pdf_print.html

8
README.md

@ -1414,7 +1414,8 @@ BaseException
| +-- IndexError # Raised when a sequence index is out of range.
| +-- KeyError # Raised when a dictionary key or set element is not found.
+-- NameError # Raised when a variable name is not found.
+-- OSError # Failures such as “file not found” or “disk full”.
+-- OSError # Errors such as “file not found” or “disk full” (see Open).
| +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
+-- RuntimeError # Raised by errors that don't fall into other categories.
| +-- RecursionError # Raised when the maximum recursion depth is exceeded.
@ -2333,9 +2334,10 @@ Progress Bar
```python
# $ pip3 install tqdm
>>> from tqdm import tqdm
>>> from time import sleep
>>> for el in tqdm([1, 2, 3], desc='Processing'):
... pass
Processing: 100%|██████████████████| 3/3 [00:00<00:00, 11516.49it/s]
... sleep(1)
Processing: 100%|██████████████████| 3/3 [00:03<00:00, 1.00s/it]
```

7
index.html

@ -1343,7 +1343,7 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
│ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
│ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is not found.</span>
├── NameError <span class="hljs-comment"># Raised when a variable name is not found.</span>
├── OSError <span class="hljs-comment"># Failures such as “file not found” or “disk full”.</span>
├── OSError <span class="hljs-comment"># Errors such as “file not found” or “disk full” (see Open).</span>
│ └── FileNotFoundError <span class="hljs-comment"># When a file or directory is requested but doesn't exist.</span>
├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall in other categories.</span>
│ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span>
@ -2038,9 +2038,10 @@ curses.wrapper(main)
<p><br></p>
<div><h1 id="libraries">Libraries</h1><div><h2 id="progressbar"><a href="#progressbar" name="progressbar">#</a>Progress Bar</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install tqdm</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> sleep
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> el <span class="hljs-keyword">in</span> tqdm([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], desc=<span class="hljs-string">'Processing'</span>):
<span class="hljs-meta">... </span> <span class="hljs-keyword">pass</span>
Processing: 100%|██████████████████| 3/3 [00:00&lt;00:00, 11516.49it/s]
<span class="hljs-meta">... </span> sleep(<span class="hljs-number">1</span>)
Processing: 100%|███████████████████| 3/3 [00:03&lt;00:00, 1.00s/it]
</code></pre></div></div>

7
parse.js

@ -66,9 +66,10 @@ const EVAL =
const PROGRESS_BAR =
'<span class="hljs-comment"># $ pip3 install tqdm</span>\n' +
'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm\n' +
'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> sleep\n' +
'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> el <span class="hljs-keyword">in</span> tqdm([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], desc=<span class="hljs-string">\'Processing\'</span>):\n' +
'<span class="hljs-meta">... </span> <span class="hljs-keyword">pass</span>\n' +
'Processing: 100%|██████████████████| 3/3 [00:00&lt;00:00, 11516.49it/s]\n';
'<span class="hljs-meta">... </span> sleep(<span class="hljs-number">1</span>)\n' +
'Processing: 100%|███████████████████| 3/3 [00:03&lt;00:00, 1.00s/it]\n';
const PYINSTALLER =
'$ pip3 install pyinstaller\n' +
@ -200,7 +201,7 @@ const DIAGRAM_7_B =
" │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" +
" │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is not found.</span>\n" +
" ├── NameError <span class='hljs-comment'># Raised when a variable name is not found.</span>\n" +
" ├── OSError <span class='hljs-comment'># Failures such as “file not found” or “disk full”.</span>\n" +
" ├── OSError <span class='hljs-comment'># Errors such as “file not found” or “disk full” (see Open).</span>\n" +
" │ └── FileNotFoundError <span class='hljs-comment'># When a file or directory is requested but doesn't exist.</span>\n" +
" ├── RuntimeError <span class='hljs-comment'># Raised by errors that don't fall in other categories.</span>\n" +
" │ └── RecursionError <span class='hljs-comment'># Raised when the maximum recursion depth is exceeded.</span>\n" +

23
pdf/index_for_pdf.html

@ -5,16 +5,15 @@
<div style="column-count: 3; width: 960px; page-break-inside: avoid">
<h3 id="a">A</h3>
<p><strong>abstract base classes, <a href="#abstractbaseclasses">4</a>, <a href="#abcsequence">19</a></strong><br>
<strong>all function, <a href="#anyall">11</a></strong><br>
<strong>animation, <a href="#animation">40</a></strong><br>
<strong>any function, <a href="#anyall">11</a></strong><br>
<strong>animation, <a href="#animation">40</a>, <a href="#pygame">42</a>-<a href="#basicmariobrothersexample">43</a></strong><br>
<strong>argparse module, <a href="#argumentparser">22</a></strong><br>
<strong>arguments, <a href="#arguments">10</a></strong><br>
<strong>arrays, <a href="#array">29</a></strong><br>
<strong>audio, <a href="#audio">40</a>-<a href="#writefloatsamplestowavfile">41</a></strong> </p>
<strong>arguments, <a href="#arguments">10</a>, <a href="#partial">12</a></strong><br>
<strong>arrays, <a href="#array">29</a>, <a href="#numpy">37</a>-<a href="#indexing">38</a></strong><br>
<strong>asyncio module, <a href="#coroutines">33</a></strong><br>
<strong>audio, <a href="#audio">40</a>-<a href="#writefloatsamplestowavfile">41</a>, <a href="#sound">42</a></strong> </p>
<h3 id="b">B</h3>
<p><strong>beautifulsoup library, <a href="#scraping">35</a></strong><br>
<strong>binary representation, <a href="#binhex">8</a></strong><br>
<strong>binary representation, <a href="#ints">7</a>, <a href="#binhex">8</a></strong><br>
<strong>bitwise operators, <a href="#bitwiseoperators">8</a></strong><br>
<strong>bottle library, <a href="#web">36</a></strong><br>
<strong>bytes, <a href="#bytes">28</a></strong> </p>
@ -23,8 +22,8 @@
<strong>callable, <a href="#callable">17</a></strong><br>
<strong>class, <a href="#type">4</a>, <a href="#class">14</a>-<a href="#abcsequence">19</a>, <a href="#metaprograming">31</a>-<a href="#metaclass">32</a></strong><br>
<strong>closure, <a href="#closure">12</a></strong><br>
<strong>collection, <a href="#abstractbaseclasses">4</a>, <a href="#collection">18</a></strong><br>
<strong>collections module, <a href="#counter">2</a>, <a href="#namedtuple">3</a>, <a href="#abstractbaseclasses">4</a>, <a href="#abcsequence">19</a>, <a href="#deque">29</a></strong><br>
<strong>collection, <a href="#abstractbaseclasses">4</a>, <a href="#collection">18</a>, <a href="#tableofrequiredandautomaticallyavailablespecialmethods">19</a></strong><br>
<strong>collections module, <a href="#dictionary">2</a>, <a href="#namedtuple">3</a>, <a href="#abstractbaseclasses">4</a>, <a href="#abcsequence">19</a>, <a href="#deque">29</a></strong><br>
<strong>combinatorics, <a href="#combinatorics">8</a></strong><br>
<strong>command line arguments, <a href="#commandlinearguments">22</a></strong><br>
<strong>comparable, <a href="#comparable">16</a></strong><br>
@ -107,7 +106,7 @@
<strong>profiling, <a href="#profiling">36</a>-<a href="#timingasnippet">37</a></strong><br>
<strong>progress bar, <a href="#progressbar">34</a></strong><br>
<strong>property decorator, <a href="#property">15</a></strong><br>
<strong>pygame library, <a href="#pygame">42</a></strong> </p>
<strong>pygame library, <a href="#pygame">42</a>-<a href="#basicmariobrothersexample">43</a></strong> </p>
<h3 id="q">Q</h3>
<p><strong>queues, <a href="#queue">30</a></strong> </p>
<h3 id="r">R</h3>
@ -129,8 +128,8 @@
<strong>sqlite module, <a href="#sqlite">27</a></strong><br>
<strong>statistics module, <a href="#statistics">7</a></strong><br>
<strong>strings, <a href="#string">5</a></strong><br>
<strong>struct module, <a href="#struct">28</a>-<a href="#integertypesusecapitalletterforunsignedtypestandardsizesareinbrackets">29</a></strong><br>
<strong>subprocess module, <a href="#usingsubprocess">25</a></strong><br>
<strong>struct module, <a href="#struct">28</a>-<a href="#integertypesuseacapitalletterforunsignedtypeminimumandstandardsizesareinbrackets">29</a></strong><br>
<strong>subprocess module, <a href="#sends11tothebasiccalculatorandcapturesitsoutput">25</a></strong><br>
<strong>super function, <a href="#inheritance">14</a></strong><br>
<strong>synthesizer, <a href="#synthesizer">41</a></strong><br>
<strong>sys module, <a href="#lrucache">15</a>, <a href="#commonbuiltinexceptions">21</a>, <a href="#print">22</a></strong> </p>

17
pdf/index_for_pdf_print.html

@ -5,16 +5,15 @@
<div style="column-count: 3; width: 960px; page-break-inside: avoid">
<h3 id="a">A</h3>
<p><strong>abstract base classes, 4, 19</strong><br>
<strong>all function, 11</strong><br>
<strong>animation, 40</strong><br>
<strong>any function, 11</strong><br>
<strong>animation, 40, 42-43</strong><br>
<strong>argparse module, 22</strong><br>
<strong>arguments, 10</strong><br>
<strong>arrays, 29</strong><br>
<strong>audio, 40-41</strong> </p>
<strong>arguments, 10, 12</strong><br>
<strong>arrays, 29, 37-38</strong><br>
<strong>asyncio module, 33</strong><br>
<strong>audio, 40-41, 42</strong> </p>
<h3 id="b">B</h3>
<p><strong>beautifulsoup library, 35</strong><br>
<strong>binary representation, 8</strong><br>
<strong>binary representation, 7, 8</strong><br>
<strong>bitwise operators, 8</strong><br>
<strong>bottle library, 36</strong><br>
<strong>bytes, 28</strong> </p>
@ -23,7 +22,7 @@
<strong>callable, 17</strong><br>
<strong>class, 4, 14-19, 31-32</strong><br>
<strong>closure, 12</strong><br>
<strong>collection, 4, 18</strong><br>
<strong>collection, 4, 18, 19</strong><br>
<strong>collections module, 2, 3, 4, 19, 29</strong><br>
<strong>combinatorics, 8</strong><br>
<strong>command line arguments, 22</strong><br>
@ -107,7 +106,7 @@
<strong>profiling, 36-37</strong><br>
<strong>progress bar, 34</strong><br>
<strong>property decorator, 15</strong><br>
<strong>pygame library, 42</strong> </p>
<strong>pygame library, 42-43</strong> </p>
<h3 id="q">Q</h3>
<p><strong>queues, 30</strong> </p>
<h3 id="r">R</h3>

Loading…
Cancel
Save