Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e2b3bb2

Browse files
committed
Exceptions, progress bar and index
1 parent aa13ea5 commit e2b3bb2

File tree

5 files changed

+32
-30
lines changed

5 files changed

+32
-30
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,7 +1414,8 @@ BaseException
14141414
| +-- IndexError # Raised when a sequence index is out of range.
14151415
| +-- KeyError # Raised when a dictionary key or set element is not found.
14161416
+-- NameError # Raised when a variable name is not found.
1417-
+-- OSError # Failures such as “file not found” or “disk full”.
1417+
+-- OSError # Errors such as “file not found” or “disk full” (see Open).
1418+
14181419
| +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
14191420
+-- RuntimeError # Raised by errors that don't fall into other categories.
14201421
| +-- RecursionError # Raised when the maximum recursion depth is exceeded.
@@ -2333,9 +2334,10 @@ Progress Bar
23332334
```python
23342335
# $ pip3 install tqdm
23352336
>>> from tqdm import tqdm
2337+
>>> from time import sleep
23362338
>>> for el in tqdm([1, 2, 3], desc='Processing'):
2337-
... pass
2338-
Processing: 100%|██████████████████| 3/3 [00:00<00:00, 11516.49it/s]
2339+
... sleep(1)
2340+
Processing: 100%|██████████████████| 3/3 [00:03<00:00, 1.00s/it]
23392341
```
23402342

23412343

index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,7 +1343,7 @@
13431343
│ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
13441344
│ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is not found.</span>
13451345
├── NameError <span class="hljs-comment"># Raised when a variable name is not found.</span>
1346-
├── OSError <span class="hljs-comment"># Failures such as “file not found” or “disk full”.</span>
1346+
├── OSError <span class="hljs-comment"># Errors such as “file not found” or “disk full” (see Open).</span>
13471347
│ └── FileNotFoundError <span class="hljs-comment"># When a file or directory is requested but doesn't exist.</span>
13481348
├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall in other categories.</span>
13491349
│ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span>
@@ -2038,9 +2038,10 @@
20382038
<p><br></p>
20392039
<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>
20402040
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm
2041+
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> sleep
20412042
<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>):
2042-
<span class="hljs-meta">... </span> <span class="hljs-keyword">pass</span>
2043-
Processing: 100%|██████████████████| 3/3 [00:00&lt;00:00, 11516.49it/s]
2043+
<span class="hljs-meta">... </span> sleep(<span class="hljs-number">1</span>)
2044+
Processing: 100%|██████████████████| 3/3 [00:03&lt;00:00, 1.00s/it]
20442045
</code></pre></div></div>
20452046

20462047

parse.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,10 @@ const EVAL =
6666
const PROGRESS_BAR =
6767
'<span class="hljs-comment"># $ pip3 install tqdm</span>\n' +
6868
'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm\n' +
69+
'<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> time <span class="hljs-keyword">import</span> sleep\n' +
6970
'<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' +
70-
'<span class="hljs-meta">... </span> <span class="hljs-keyword">pass</span>\n' +
71-
'Processing: 100%|██████████████████| 3/3 [00:00&lt;00:00, 11516.49it/s]\n';
71+
'<span class="hljs-meta">... </span> sleep(<span class="hljs-number">1</span>)\n' +
72+
'Processing: 100%|██████████████████| 3/3 [00:03&lt;00:00, 1.00s/it]\n';
7273

7374
const PYINSTALLER =
7475
'$ pip3 install pyinstaller\n' +
@@ -200,7 +201,7 @@ const DIAGRAM_7_B =
200201
" │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" +
201202
" │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is not found.</span>\n" +
202203
" ├── NameError <span class='hljs-comment'># Raised when a variable name is not found.</span>\n" +
203-
" ├── OSError <span class='hljs-comment'># Failures such as “file not found” or “disk full”.</span>\n" +
204+
" ├── OSError <span class='hljs-comment'># Errors such as “file not found” or “disk full” (see Open).</span>\n" +
204205
" │ └── FileNotFoundError <span class='hljs-comment'># When a file or directory is requested but doesn't exist.</span>\n" +
205206
" ├── RuntimeError <span class='hljs-comment'># Raised by errors that don't fall in other categories.</span>\n" +
206207
" │ └── RecursionError <span class='hljs-comment'># Raised when the maximum recursion depth is exceeded.</span>\n" +

pdf/index_for_pdf.html

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ <h2 id="index"><a href="#index" name="index">#</a>Index</h2>
55
<div style="column-count: 3; width: 960px; page-break-inside: avoid">
66
<h3 id="a">A</h3>
77
<p><strong>abstract base classes, <a href="#abstractbaseclasses">4</a>, <a href="#abcsequence">19</a></strong><br>
8-
<strong>all function, <a href="#anyall">11</a></strong><br>
9-
<strong>animation, <a href="#animation">40</a></strong><br>
10-
<strong>any function, <a href="#anyall">11</a></strong><br>
8+
<strong>animation, <a href="#animation">40</a>, <a href="#pygame">42</a>-<a href="#basicmariobrothersexample">43</a></strong><br>
119
<strong>argparse module, <a href="#argumentparser">22</a></strong><br>
12-
<strong>arguments, <a href="#arguments">10</a></strong><br>
13-
<strong>arrays, <a href="#array">29</a></strong><br>
14-
<strong>audio, <a href="#audio">40</a>-<a href="#writefloatsamplestowavfile">41</a></strong> </p>
10+
<strong>arguments, <a href="#arguments">10</a>, <a href="#partial">12</a></strong><br>
11+
<strong>arrays, <a href="#array">29</a>, <a href="#numpy">37</a>-<a href="#indexing">38</a></strong><br>
12+
<strong>asyncio module, <a href="#coroutines">33</a></strong><br>
13+
<strong>audio, <a href="#audio">40</a>-<a href="#writefloatsamplestowavfile">41</a>, <a href="#sound">42</a></strong> </p>
1514
<h3 id="b">B</h3>
1615
<p><strong>beautifulsoup library, <a href="#scraping">35</a></strong><br>
17-
<strong>binary representation, <a href="#binhex">8</a></strong><br>
16+
<strong>binary representation, <a href="#ints">7</a>, <a href="#binhex">8</a></strong><br>
1817
<strong>bitwise operators, <a href="#bitwiseoperators">8</a></strong><br>
1918
<strong>bottle library, <a href="#web">36</a></strong><br>
2019
<strong>bytes, <a href="#bytes">28</a></strong> </p>
@@ -23,8 +22,8 @@ <h3 id="c">C</h3>
2322
<strong>callable, <a href="#callable">17</a></strong><br>
2423
<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>
2524
<strong>closure, <a href="#closure">12</a></strong><br>
26-
<strong>collection, <a href="#abstractbaseclasses">4</a>, <a href="#collection">18</a></strong><br>
27-
<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>
25+
<strong>collection, <a href="#abstractbaseclasses">4</a>, <a href="#collection">18</a>, <a href="#tableofrequiredandautomaticallyavailablespecialmethods">19</a></strong><br>
26+
<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>
2827
<strong>combinatorics, <a href="#combinatorics">8</a></strong><br>
2928
<strong>command line arguments, <a href="#commandlinearguments">22</a></strong><br>
3029
<strong>comparable, <a href="#comparable">16</a></strong><br>
@@ -107,7 +106,7 @@ <h3 id="p">P</h3>
107106
<strong>profiling, <a href="#profiling">36</a>-<a href="#timingasnippet">37</a></strong><br>
108107
<strong>progress bar, <a href="#progressbar">34</a></strong><br>
109108
<strong>property decorator, <a href="#property">15</a></strong><br>
110-
<strong>pygame library, <a href="#pygame">42</a></strong> </p>
109+
<strong>pygame library, <a href="#pygame">42</a>-<a href="#basicmariobrothersexample">43</a></strong> </p>
111110
<h3 id="q">Q</h3>
112111
<p><strong>queues, <a href="#queue">30</a></strong> </p>
113112
<h3 id="r">R</h3>
@@ -129,8 +128,8 @@ <h3 id="s">S</h3>
129128
<strong>sqlite module, <a href="#sqlite">27</a></strong><br>
130129
<strong>statistics module, <a href="#statistics">7</a></strong><br>
131130
<strong>strings, <a href="#string">5</a></strong><br>
132-
<strong>struct module, <a href="#struct">28</a>-<a href="#integertypesusecapitalletterforunsignedtypestandardsizesareinbrackets">29</a></strong><br>
133-
<strong>subprocess module, <a href="#usingsubprocess">25</a></strong><br>
131+
<strong>struct module, <a href="#struct">28</a>-<a href="#integertypesuseacapitalletterforunsignedtypeminimumandstandardsizesareinbrackets">29</a></strong><br>
132+
<strong>subprocess module, <a href="#sends11tothebasiccalculatorandcapturesitsoutput">25</a></strong><br>
134133
<strong>super function, <a href="#inheritance">14</a></strong><br>
135134
<strong>synthesizer, <a href="#synthesizer">41</a></strong><br>
136135
<strong>sys module, <a href="#lrucache">15</a>, <a href="#commonbuiltinexceptions">21</a>, <a href="#print">22</a></strong> </p>

pdf/index_for_pdf_print.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ <h2 id="index"><a href="#index" name="index">#</a>Index</h2>
55
<div style="column-count: 3; width: 960px; page-break-inside: avoid">
66
<h3 id="a">A</h3>
77
<p><strong>abstract base classes, 4, 19</strong><br>
8-
<strong>all function, 11</strong><br>
9-
<strong>animation, 40</strong><br>
10-
<strong>any function, 11</strong><br>
8+
<strong>animation, 40, 42-43</strong><br>
119
<strong>argparse module, 22</strong><br>
12-
<strong>arguments, 10</strong><br>
13-
<strong>arrays, 29</strong><br>
14-
<strong>audio, 40-41</strong> </p>
10+
<strong>arguments, 10, 12</strong><br>
11+
<strong>arrays, 29, 37-38</strong><br>
12+
<strong>asyncio module, 33</strong><br>
13+
<strong>audio, 40-41, 42</strong> </p>
1514
<h3 id="b">B</h3>
1615
<p><strong>beautifulsoup library, 35</strong><br>
17-
<strong>binary representation, 8</strong><br>
16+
<strong>binary representation, 7, 8</strong><br>
1817
<strong>bitwise operators, 8</strong><br>
1918
<strong>bottle library, 36</strong><br>
2019
<strong>bytes, 28</strong> </p>
@@ -23,7 +22,7 @@ <h3 id="c">C</h3>
2322
<strong>callable, 17</strong><br>
2423
<strong>class, 4, 14-19, 31-32</strong><br>
2524
<strong>closure, 12</strong><br>
26-
<strong>collection, 4, 18</strong><br>
25+
<strong>collection, 4, 18, 19</strong><br>
2726
<strong>collections module, 2, 3, 4, 19, 29</strong><br>
2827
<strong>combinatorics, 8</strong><br>
2928
<strong>command line arguments, 22</strong><br>
@@ -107,7 +106,7 @@ <h3 id="p">P</h3>
107106
<strong>profiling, 36-37</strong><br>
108107
<strong>progress bar, 34</strong><br>
109108
<strong>property decorator, 15</strong><br>
110-
<strong>pygame library, 42</strong> </p>
109+
<strong>pygame library, 42-43</strong> </p>
111110
<h3 id="q">Q</h3>
112111
<p><strong>queues, 30</strong> </p>
113112
<h3 id="r">R</h3>

0 commit comments

Comments
 (0)