Skip to content

Commit 8447a11

Browse files
committed
Web, Virtual environments
1 parent fa8a4c6 commit 8447a11

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ app.run(host=None, port=None, debug=None) # Or: $ flask --app FILE run [--ARG[=
25632563
```python
25642564
@app.route('/img/<path:filename>')
25652565
def serve_file(filename):
2566-
return fl.send_from_directory('DIRNAME/', filename)
2566+
return fl.send_from_directory('DIRNAME', filename)
25672567
```
25682568

25692569
### Dynamic Request
@@ -3549,7 +3549,7 @@ cdef class <class_name>:
35493549

35503550
```perl
35513551
$ python3 -m venv NAME # Creates virtual environment in current directory.
3552-
$ source NAME/bin/activate # Activates env. On Windows run `NAME\Scripts\activate`.
3552+
$ source NAME/bin/activate # Activates it. On Windows run `NAME\Scripts\activate`.
35533553
$ pip3 install LIBRARY # Installs the library into active environment.
35543554
$ python3 FILE # Runs the script in active environment. Also `./FILE`.
35553555
$ deactivate # Deactivates the active virtual environment.

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<body>
5858
<header>
59-
<aside>February 27, 2025</aside>
59+
<aside>February 28, 2025</aside>
6060
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
6161
</header>
6262

@@ -2107,7 +2107,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
21072107
</ul>
21082108
<div><h3 id="staticrequest">Static Request</h3><pre><code class="python language-python hljs"><span class="hljs-meta">@app.route('/img/&lt;path:filename&gt;')</span>
21092109
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">serve_file</span><span class="hljs-params">(filename)</span>:</span>
2110-
<span class="hljs-keyword">return</span> fl.send_from_directory(<span class="hljs-string">'DIRNAME/'</span>, filename)
2110+
<span class="hljs-keyword">return</span> fl.send_from_directory(<span class="hljs-string">'DIRNAME'</span>, filename)
21112111
</code></pre></div>
21122112

21132113
<div><h3 id="dynamicrequest">Dynamic Request</h3><pre><code class="python language-python hljs"><span class="hljs-meta">@app.route('/&lt;sport&gt;')</span>
@@ -2898,7 +2898,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
28982898
self.&lt;attr_name&gt; = &lt;arg_name&gt;
28992899
</code></pre>
29002900
<div><h3 id="virtualenvironments">Virtual Environments</h3><p><strong>System for installing libraries directly into project's directory.</strong></p><pre><code class="python hljs">$ python3 -m venv NAME <span class="hljs-comment"># Creates virtual environment in current directory.</span>
2901-
$ source NAME/bin/activate <span class="hljs-comment"># Activates env. On Windows run `NAME\Scripts\activate`.</span>
2901+
$ source NAME/bin/activate <span class="hljs-comment"># Activates it. On Windows run `NAME\Scripts\activate`.</span>
29022902
$ pip3 install LIBRARY <span class="hljs-comment"># Installs the library into active environment.</span>
29032903
$ python3 FILE <span class="hljs-comment"># Runs the script in active environment. Also `./FILE`.</span>
29042904
$ deactivate <span class="hljs-comment"># Deactivates the active virtual environment.</span>
@@ -2942,7 +2942,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29422942

29432943

29442944
<footer>
2945-
<aside>February 27, 2025</aside>
2945+
<aside>February 28, 2025</aside>
29462946
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29472947
</footer>
29482948

pdf/remove_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
MATCHES = {
1010
'<strong>For details about sort(), sorted(), min() and max() see <a href="#sortable">Sortable</a>.</strong>': '<strong>For details about sort(), sorted(), min() and max() see Sortable (p. 16).</strong>',
11-
'<strong>Module <a href="#operator">operator</a> has function itemgetter() that can replace listed <a href="#lambda">lambdas</a>.</strong>': '<strong>Module \'operator\' (p. 31) has function itemgetter() that can replace listed lambdas (p. 11).</strong>',
11+
'<strong>Module <a href="#operator">operator</a> has function itemgetter() that can replace listed <a href="#lambda">lambdas</a>.</strong>': '<strong>Module \'operator\' has function itemgetter() that can replace listed lambdas (p. 31).</strong>',
1212
'<strong>This text uses the term collection instead of iterable. For rationale see <a href="#collection">Collection</a>.</strong>': '<strong>This text uses the term collection instead of iterable. For rationale see Collection (p. 18).</strong>',
1313
'<strong>Adding <code class="python hljs"><span class="hljs-string">\'!r\'</span></code> to the expression converts object to string by calling its <a href="#class">repr()</a> method.</strong>': '<strong>Adding <code class="python hljs"><span class="hljs-string">\'!r\'</span></code> to the expression converts object to string by calling its repr() method.</strong>',
1414
'<strong>It can be any <a href="#callable">callable</a>, but is usually implemented as a function that returns a <a href="#closure">closure</a>.</strong>': '<strong>It can be any callable, but is usually implemented as a function that returns a closure.</strong>',

0 commit comments

Comments
 (0)