Browse Source

Exceptions, Web

pull/140/head
Jure Šorn 2 years ago
parent
commit
0d0bf6b061
3 changed files with 15 additions and 13 deletions
  1. 9
      README.md
  2. 11
      index.html
  3. 8
      parse.js

9
README.md

@ -1445,13 +1445,13 @@ BaseException
+-- AssertionError # Raised by `assert <exp>` if expression returns false value. +-- AssertionError # Raised by `assert <exp>` if expression returns false value.
+-- AttributeError # Raised when an attribute is missing. +-- AttributeError # Raised when an attribute is missing.
+-- EOFError # Raised by input() when it hits end-of-file condition. +-- EOFError # Raised by input() when it hits end-of-file condition.
+-- LookupError # Raised when a look-up on a collection fails.
+-- LookupError # Base class for errors when a collection can't find an item.
| +-- IndexError # Raised when a sequence index is out of range. | +-- IndexError # Raised when a sequence index is out of range.
| +-- KeyError # Raised when a dictionary key or set element is missing. | +-- KeyError # Raised when a dictionary key or set element is missing.
+-- MemoryError # Out of memory. Could be too late to start deleting vars. +-- MemoryError # Out of memory. Could be too late to start deleting vars.
+-- NameError # Raised when an object is missing.
+-- OSError # Errors such as “file not found” or “disk full” (see Open).
| +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
+-- NameError # Raised when nonexistent name (variable/func/class) is used.
| +-- UnboundLocalError # Raised when local name is used before it's being defined.
+-- OSError # Errors such as FileExistsError/PermissionError (see Open).
+-- RuntimeError # Raised by errors that don't fall into other categories. +-- RuntimeError # Raised by errors that don't fall into other categories.
| +-- RecursionError # Raised when the maximum recursion depth is exceeded. | +-- RecursionError # Raised when the maximum recursion depth is exceeded.
+-- StopIteration # Raised by next() when run on an empty iterator. +-- StopIteration # Raised by next() when run on an empty iterator.
@ -2518,6 +2518,7 @@ except requests.exceptions.ConnectionError:
Web Web
--- ---
**Bottle is a micro web framework/server. If you just want to open a html file in a web browser use `'webbrowser.open(<path>)'` instead.**
```python ```python
# $ pip3 install bottle # $ pip3 install bottle
from bottle import run, route, static_file, template, post, request, response from bottle import run, route, static_file, template, post, request, response

11
index.html

@ -1239,13 +1239,13 @@ error_msg = <span class="hljs-string">''</span>.join(traceback.format_exception(
├── AssertionError <span class="hljs-comment"># Raised by `assert &lt;exp&gt;` if expression returns false value.</span> ├── AssertionError <span class="hljs-comment"># Raised by `assert &lt;exp&gt;` if expression returns false value.</span>
├── AttributeError <span class="hljs-comment"># Raised when an attribute is missing.</span> ├── AttributeError <span class="hljs-comment"># Raised when an attribute is missing.</span>
├── EOFError <span class="hljs-comment"># Raised by input() when it hits end-of-file condition.</span> ├── EOFError <span class="hljs-comment"># Raised by input() when it hits end-of-file condition.</span>
├── LookupError <span class="hljs-comment"># Raised when a look-up on a collection fails.</span>
├── LookupError <span class="hljs-comment"># Base class for errors when a collection can't find an item.</span>
│ ├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span> │ ├── 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 missing.</span> │ └── KeyError <span class="hljs-comment"># Raised when a dictionary key or set element is missing.</span>
├── MemoryError <span class="hljs-comment"># Out of memory. Could be too late to start deleting vars.</span> ├── MemoryError <span class="hljs-comment"># Out of memory. Could be too late to start deleting vars.</span>
├── NameError <span class="hljs-comment"># Raised when an object is missing.</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>
├── NameError <span class="hljs-comment"># Raised when nonexistent name (variable/func/class) is used.</span>
│ └── UnboundLocalError <span class="hljs-comment"># Raised when local name is used before it's being defined.</span>
├── OSError <span class="hljs-comment"># Errors such as FileExistsError/PermissionError (see Open).</span>
├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall into other categories.</span> ├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall into other categories.</span>
│ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span> │ └── RecursionError <span class="hljs-comment"># Raised when the maximum recursion depth is exceeded.</span>
├── StopIteration <span class="hljs-comment"># Raised by next() when run on an empty iterator.</span> ├── StopIteration <span class="hljs-comment"># Raised by next() when run on an empty iterator.</span>
@ -2067,11 +2067,12 @@ WIKI_URL = <span class="hljs-string">'https://en.wikipedia.org/wiki/Python_(prog
</code></pre></div></div> </code></pre></div></div>
<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>
<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(&lt;path&gt;)'</span></code> instead.</strong></p><pre><code class="python language-python hljs"><span class="hljs-comment"># $ pip3 install bottle</span>
<span class="hljs-keyword">from</span> bottle <span class="hljs-keyword">import</span> run, route, static_file, template, post, request, response <span class="hljs-keyword">from</span> bottle <span class="hljs-keyword">import</span> run, route, static_file, template, post, request, response
<span class="hljs-keyword">import</span> json <span class="hljs-keyword">import</span> json
</code></pre></div> </code></pre></div>
<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> <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>
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> 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>
</code></pre></div> </code></pre></div>

8
parse.js

@ -367,13 +367,13 @@ const DIAGRAM_7_B =
" ├── AssertionError <span class='hljs-comment'># Raised by `assert &lt;exp&gt;` if expression returns false value.</span>\n" + " ├── AssertionError <span class='hljs-comment'># Raised by `assert &lt;exp&gt;` if expression returns false value.</span>\n" +
" ├── AttributeError <span class='hljs-comment'># Raised when an attribute is missing.</span>\n" + " ├── AttributeError <span class='hljs-comment'># Raised when an attribute is missing.</span>\n" +
" ├── EOFError <span class='hljs-comment'># Raised by input() when it hits end-of-file condition.</span>\n" + " ├── EOFError <span class='hljs-comment'># Raised by input() when it hits end-of-file condition.</span>\n" +
" ├── LookupError <span class='hljs-comment'># Raised when a look-up on a collection fails.</span>\n" +
" ├── LookupError <span class='hljs-comment'># Base class for errors when a collection can't find an item.</span>\n" +
" │ ├── IndexError <span class='hljs-comment'># Raised when a sequence index is out of range.</span>\n" + " │ ├── 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 missing.</span>\n" + " │ └── KeyError <span class='hljs-comment'># Raised when a dictionary key or set element is missing.</span>\n" +
" ├── MemoryError <span class='hljs-comment'># Out of memory. Could be too late to start deleting vars.</span>\n" + " ├── MemoryError <span class='hljs-comment'># Out of memory. Could be too late to start deleting vars.</span>\n" +
" ├── NameError <span class='hljs-comment'># Raised when an object is missing.</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" +
" ├── NameError <span class='hljs-comment'># Raised when nonexistent name (variable/func/class) is used.</span>\n" +
" │ └── UnboundLocalError <span class='hljs-comment'># Raised when local name is used before it's being defined.</span>\n" +
" ├── OSError <span class='hljs-comment'># Errors such as FileExistsError/PermissionError (see Open).</span>\n" +
" ├── RuntimeError <span class='hljs-comment'># Raised by errors that don't fall into other categories.</span>\n" + " ├── RuntimeError <span class='hljs-comment'># Raised by errors that don't fall into other categories.</span>\n" +
" │ └── RecursionError <span class='hljs-comment'># Raised when the maximum recursion depth is exceeded.</span>\n" + " │ └── RecursionError <span class='hljs-comment'># Raised when the maximum recursion depth is exceeded.</span>\n" +
" ├── StopIteration <span class='hljs-comment'># Raised by next() when run on an empty iterator.</span>\n" + " ├── StopIteration <span class='hljs-comment'># Raised by next() when run on an empty iterator.</span>\n" +

Loading…
Cancel
Save