Browse Source

Threading and Web

pull/46/head
Jure Šorn 5 years ago
parent
commit
9ba56751ef
2 changed files with 6 additions and 2 deletions
  1. 3
      README.md
  2. 5
      index.html

3
README.md

@ -2014,6 +2014,7 @@ thread.start()
<bool> = thread.is_alive() # Checks if thread has finished executing. <bool> = thread.is_alive() # Checks if thread has finished executing.
thread.join() # Waits for thread to finish. thread.join() # Waits for thread to finish.
``` ```
* **Use `'kwargs=<dict>'` to pass keyword arguments to the function.**
### Lock ### Lock
```python ```python
@ -2394,7 +2395,7 @@ Web
--- ---
```python ```python
# $ pip3 install bottle # $ pip3 install bottle
from bottle import run, route, post, template, request, response
from bottle import run, route, static_file, template, post, request, response
import json import json
``` ```

5
index.html

@ -1775,6 +1775,9 @@ thread.start()
thread.join() <span class="hljs-comment"># Waits for thread to finish.</span> thread.join() <span class="hljs-comment"># Waits for thread to finish.</span>
</code></pre></div> </code></pre></div>
<ul>
<li><strong>Use <code class="python hljs"><span class="hljs-string">'kwargs=&lt;dict&gt;'</span></code> to pass keyword arguments to the function.</strong></li>
</ul>
<div><h3 id="lock">Lock</h3><pre><code class="python language-python hljs">lock = RLock() <div><h3 id="lock">Lock</h3><pre><code class="python language-python hljs">lock = RLock()
lock.acquire() <span class="hljs-comment"># Waits for lock to be available.</span> lock.acquire() <span class="hljs-comment"># Waits for lock to be available.</span>
... ...
@ -2059,7 +2062,7 @@ print(link, ver)
<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><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, post, template, 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>

Loading…
Cancel
Save