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

Skip to content

Commit 74fd89c

Browse files
committed
Argument parser, Operator, Web
1 parent 6eb148e commit 74fd89c

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ value = args.<name>
15531553
```
15541554

15551555
* **Use `'help=<str>'` to set argument description that will be displayed in help message.**
1556-
* **Use `'default=<el>'` to set the default value.**
1556+
* **Use `'default=<el>'` to set argument's default value.**
15571557
* **Use `'type=FileType(<mode>)'` for files. Accepts 'encoding', but 'newline' is None.**
15581558

15591559

@@ -2177,7 +2177,7 @@ product_of_elems = functools.reduce(op.mul, <collection>)
21772177
union_of_sets = functools.reduce(op.or_, <coll_of_sets>)
21782178
first_element = op.methodcaller('pop', 0)(<list>)
21792179
```
2180-
* **Bitwise operators require objects to have and(), or() and xor() special methods, unlike logical operators that work on all types of objects.**
2180+
* **Bitwise operators require objects to have and(), or(), xor() and invert() special methods, unlike logical operators that work on all types of objects.**
21812181
* **Also: `'<bool> = <bool> &|^ <bool>'` and `'<int> = <bool> &|^ <int>'`.**
21822182

21832183

@@ -2191,7 +2191,7 @@ Introspection
21912191

21922192
### Attributes
21932193
```python
2194-
<list> = dir(<object>) # Names of object's attributes (incl. methods).
2194+
<list> = dir(<object>) # Names of object's attributes (including methods).
21952195
<dict> = vars(<object>) # Dict of writable attributes. Also <obj>.__dict__.
21962196
<bool> = hasattr(<object>, '<attr_name>') # Checks if getattr() raises an AttributeError.
21972197
value = getattr(<object>, '<attr_name>') # Raises AttributeError if attribute is missing.
@@ -2564,7 +2564,7 @@ def serve_json(sport):
25642564
return {'team': team, 'odds': [2.09, 3.74, 3.68]}
25652565
```
25662566

2567-
#### Starts the app in its own thread and queries it with a post request:
2567+
#### Starts the app in its own thread and queries its REST API:
25682568
```python
25692569
# $ pip3 install requests
25702570
>>> import threading, requests
@@ -3167,7 +3167,7 @@ Name: a, dtype: int64
31673167
```
31683168

31693169
```python
3170-
<Sr> = pd.concat(<coll_of_Sr>) # Concats multiple Series into one long Series.
3170+
<Sr> = pd.concat(<coll_of_Sr>) # Concats multiple series into one long Series.
31713171
<Sr> = <Sr>.combine_first(<Sr>) # Adds items that are not yet present.
31723172
<Sr>.update(<Sr>) # Updates items that are already present.
31733173
```

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@
13221322

13231323
<ul>
13241324
<li><strong>Use <code class="python hljs"><span class="hljs-string">'help=&lt;str&gt;'</span></code> to set argument description that will be displayed in help message.</strong></li>
1325-
<li><strong>Use <code class="python hljs"><span class="hljs-string">'default=&lt;el&gt;'</span></code> to set the default value.</strong></li>
1325+
<li><strong>Use <code class="python hljs"><span class="hljs-string">'default=&lt;el&gt;'</span></code> to set argument's default value.</strong></li>
13261326
<li><strong>Use <code class="python hljs"><span class="hljs-string">'type=FileType(&lt;mode&gt;)'</span></code> for files. Accepts 'encoding', but 'newline' is None.</strong></li>
13271327
</ul>
13281328
<div><h2 id="open"><a href="#open" name="open">#</a>Open</h2><p><strong>Opens the file and returns a corresponding file object.</strong></p><pre><code class="python language-python hljs">&lt;file&gt; = open(&lt;path&gt;, mode=<span class="hljs-string">'r'</span>, encoding=<span class="hljs-keyword">None</span>, newline=<span class="hljs-keyword">None</span>)
@@ -1800,15 +1800,15 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
18001800
first_element = op.methodcaller(<span class="hljs-string">'pop'</span>, <span class="hljs-number">0</span>)(&lt;list&gt;)
18011801
</code></pre>
18021802
<ul>
1803-
<li><strong>Bitwise operators require objects to have and(), or() and xor() special methods, unlike logical operators that work on all types of objects.</strong></li>
1803+
<li><strong>Bitwise operators require objects to have and(), or(), xor() and invert() special methods, unlike logical operators that work on all types of objects.</strong></li>
18041804
<li><strong>Also: <code class="python hljs"><span class="hljs-string">'&lt;bool&gt; = &lt;bool&gt; &amp;|^ &lt;bool&gt;'</span></code> and <code class="python hljs"><span class="hljs-string">'&lt;int&gt; = &lt;bool&gt; &amp;|^ &lt;int&gt;'</span></code>.</strong></li>
18051805
</ul>
18061806
<div><h2 id="introspection"><a href="#introspection" name="introspection">#</a>Introspection</h2><pre><code class="python language-python hljs">&lt;list&gt; = dir() <span class="hljs-comment"># Names of local variables, functions, classes, etc.</span>
18071807
&lt;dict&gt; = vars() <span class="hljs-comment"># Dict of local variables, etc. Also locals().</span>
18081808
&lt;dict&gt; = globals() <span class="hljs-comment"># Dict of global vars, etc. (incl. '__builtins__').</span>
18091809
</code></pre></div>
18101810

1811-
<div><h3 id="attributes">Attributes</h3><pre><code class="python language-python hljs">&lt;list&gt; = dir(&lt;object&gt;) <span class="hljs-comment"># Names of object's attributes (incl. methods).</span>
1811+
<div><h3 id="attributes">Attributes</h3><pre><code class="python language-python hljs">&lt;list&gt; = dir(&lt;object&gt;) <span class="hljs-comment"># Names of object's attributes (including methods).</span>
18121812
&lt;dict&gt; = vars(&lt;object&gt;) <span class="hljs-comment"># Dict of writable attributes. Also &lt;obj&gt;.__dict__.</span>
18131813
&lt;bool&gt; = hasattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>) <span class="hljs-comment"># Checks if getattr() raises an AttributeError.</span>
18141814
value = getattr(&lt;object&gt;, <span class="hljs-string">'&lt;attr_name&gt;'</span>) <span class="hljs-comment"># Raises AttributeError if attribute is missing.</span>
@@ -2106,7 +2106,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
21062106
<span class="hljs-keyword">return</span> {<span class="hljs-string">'team'</span>: team, <span class="hljs-string">'odds'</span>: [<span class="hljs-number">2.09</span>, <span class="hljs-number">3.74</span>, <span class="hljs-number">3.68</span>]}
21072107
</code></pre></div>
21082108

2109-
<div><h4 id="startstheappinitsownthreadandqueriesitwithapostrequest">Starts the app in its own thread and queries it with a post request:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install requests</span>
2109+
<div><h4 id="startstheappinitsownthreadandqueriesitsrestapi">Starts the app in its own thread and queries its REST API:</h4><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install requests</span>
21102110
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> threading, requests
21112111
<span class="hljs-meta">&gt;&gt;&gt; </span>threading.Thread(target=app.run, daemon=<span class="hljs-keyword">True</span>).start()
21122112
<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">'http://localhost:5000/football/odds'</span>
@@ -2588,7 +2588,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
25882588
<pre><code class="python language-python hljs">&lt;Sr&gt; = &lt;Sr&gt; &gt; &lt;el/Sr&gt; <span class="hljs-comment"># Returns a Series of bools.</span>
25892589
&lt;Sr&gt; = &lt;Sr&gt; + &lt;el/Sr&gt; <span class="hljs-comment"># Items with non-matching keys get value NaN.</span>
25902590
</code></pre>
2591-
<pre><code class="python language-python hljs">&lt;Sr&gt; = pd.concat(&lt;coll_of_Sr&gt;) <span class="hljs-comment"># Concats multiple Series into one long Series.</span>
2591+
<pre><code class="python language-python hljs">&lt;Sr&gt; = pd.concat(&lt;coll_of_Sr&gt;) <span class="hljs-comment"># Concats multiple series into one long Series.</span>
25922592
&lt;Sr&gt; = &lt;Sr&gt;.combine_first(&lt;Sr&gt;) <span class="hljs-comment"># Adds items that are not yet present.</span>
25932593
&lt;Sr&gt;.update(&lt;Sr&gt;) <span class="hljs-comment"># Updates items that are already present.</span>
25942594
</code></pre>

pdf/index_for_pdf.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h3 id="r">R</h3>
116116
<strong>recursion, <a href="#lrucache">13</a></strong><br>
117117
<strong>reduce function, <a href="#mapfilterreduce">11</a>, <a href="#operator">31</a></strong><br>
118118
<strong>regular expressions, <a href="#regex">5</a>-<a href="#specialsequences">6</a></strong><br>
119-
<strong>requests library, <a href="#scrapespythonsurlversionnumberandlogofromitswikipediapage">35</a>, <a href="#startstheappinitsownthreadandqueriesitwithapostrequest">36</a></strong> </p>
119+
<strong>requests library, <a href="#scrapespythonsurlversionnumberandlogofromitswikipediapage">35</a>, <a href="#startstheappinitsownthreadandqueriesitsrestapi">36</a></strong> </p>
120120
<h3 id="s">S</h3>
121121
<p><strong>scope, <a href="#insidefunctiondefinition">10</a>, <a href="#nonlocal">12</a>, <a href="#complexexample">20</a></strong><br>
122122
<strong>scraping, <a href="#scraping">35</a>, <a href="#basicmariobrothersexample">43</a>, <a href="#dataframeencodedecodeplot">46</a>, <a href="#displaysalinechartoftotalcoronavirusdeathspermilliongroupedbycontinent">47</a>-<a href="#displaysamultiaxislinechartoftotalcoronaviruscasesandchangesinpricesofbitcoindowjonesandgold">48</a></strong><br>

0 commit comments

Comments
 (0)