Browse Source

Asyncio

pull/52/head
Jure Šorn 5 years ago
parent
commit
3ec9930e8c
2 changed files with 2 additions and 0 deletions
  1. 1
      README.md
  2. 1
      index.html

1
README.md

@ -2263,6 +2263,7 @@ Coroutines
* **Coroutine definition starts with `'async'` and its call with `'await'`.**
* **`'asyncio.run(<coroutine>)'` is the main entry point for asynchronous programs.**
* **Functions wait(), gather() and as_completed() can be used when multiple coroutines need to be started at the same time.**
* **Asyncio module also provides it's own Queue, Event, Lock and Semaphore classes.**
#### Runs a terminal game where you control an asterisk that must avoid numbers:

1
index.html

@ -1963,6 +1963,7 @@ ValueError: malformed node or string
<li><strong>Coroutine definition starts with <code class="python hljs"><span class="hljs-string">'async'</span></code> and its call with <code class="python hljs"><span class="hljs-string">'await'</span></code>.</strong></li>
<li><strong><code class="python hljs"><span class="hljs-string">'asyncio.run(&lt;coroutine&gt;)'</span></code> is the main entry point for asynchronous programs.</strong></li>
<li><strong>Functions wait(), gather() and as_completed() can be used when multiple coroutines need to be started at the same time.</strong></li>
<li><strong>Asyncio module also provides it's own Queue, Event, Lock and Semaphore classes.</strong></li>
</ul><div><h4 id="runsaterminalgamewhereyoucontrolanasteriskthatmustavoidnumbers">Runs a terminal game where you control an asterisk that must avoid numbers:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> asyncio, collections, curses, enum, random
P = collections.namedtuple(<span class="hljs-string">'P'</span>, <span class="hljs-string">'x y'</span>) <span class="hljs-comment"># Position</span>

Loading…
Cancel
Save