|
1239 | 1239 | ├── AssertionError <span class="hljs-comment"># Raised by `assert <exp>` if expression returns false value.</span>
|
1240 | 1240 | ├── AttributeError <span class="hljs-comment"># Raised when an attribute is missing.</span>
|
1241 | 1241 | ├── EOFError <span class="hljs-comment"># Raised by input() when it hits end-of-file condition.</span>
|
1242 |
| - ├── LookupError <span class="hljs-comment"># Raised when a look-up on a collection fails.</span> |
| 1242 | + ├── LookupError <span class="hljs-comment"># Base class for errors when a collection can't find an item.</span> |
1243 | 1243 | │ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
|
1244 | 1244 | │ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is missing.</span>
|
1245 | 1245 | ├── MemoryError <span class="hljs-comment"># Out of memory. Could be too late to start deleting vars.</span>
|
1246 |
| - ├── NameError <span class="hljs-comment"># Raised when an object is missing.</span> |
1247 |
| - ├── OSError <span class="hljs-comment"># Errors such as “file not found” or “disk full” (see Open).</span> |
1248 |
| - │ └── FileNotFoundError <span class="hljs-comment"># When a file or directory is requested but doesn't exist.</span> |
| 1246 | + ├── NameError <span class="hljs-comment"># Raised when nonexistent name (variable/func/class) is used.</span> |
| 1247 | + │ └── UnboundLocalError <span class="hljs-comment"># Raised when local name is used before it's being defined.</span> |
| 1248 | + ├── OSError <span class="hljs-comment"># Errors such as FileExistsError/PermissionError (see Open).</span> |
1249 | 1249 | ├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall into other categories.</span>
|
1250 | 1250 | │ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span>
|
1251 | 1251 | ├── StopIteration <span class="hljs-comment"># Raised by next() when run on an empty iterator.</span>
|
@@ -2067,11 +2067,12 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
|
2067 | 2067 | </code></pre></div></div>
|
2068 | 2068 |
|
2069 | 2069 |
|
2070 |
| -<div><h2 id="web"><a href="#web" name="web">#</a>Web</h2><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install bottle</span> |
| 2070 | +<div><h2 id="web"><a href="#web" name="web">#</a>Web</h2><p><strong>Bottle is a micro web framework/server. If you just want to open a html file in a web browser use <code class="python hljs"><span class="hljs-string">'webbrowser.open(<path>)'</span></code> instead.</strong></p><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install bottle</span> |
2071 | 2071 | <span class="hljs-keyword">from</span> bottle <span class="hljs-keyword">import</span> run, route, static_file, template, post, request, response
|
2072 | 2072 | <span class="hljs-keyword">import</span> json
|
2073 | 2073 | </code></pre></div>
|
2074 | 2074 |
|
| 2075 | + |
2075 | 2076 | <div><h3 id="run">Run</h3><pre><code class="python language-python hljs">run(host=<span class="hljs-string">'localhost'</span>, port=<span class="hljs-number">8080</span>) <span class="hljs-comment"># Runs locally.</span>
|
2076 | 2077 | run(host=<span class="hljs-string">'0.0.0.0'</span>, port=<span class="hljs-number">80</span>) <span class="hljs-comment"># Runs globally.</span>
|
2077 | 2078 | </code></pre></div>
|
|
0 commit comments