bpo-33649: Add a hello world example to asyncio.rst (GH-9374)

This commit is contained in:
Yury Selivanov 2018-09-17 18:41:59 -04:00 committed by GitHub
parent 188ebfa475
commit 3085534c39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,19 @@
--------------
.. sidebar:: Hello World!
.. code-block:: python
import asyncio
async def main():
print('Hello ...')
await asyncio.sleep(1)
print('... World!')
asyncio.run(main())
asyncio is a library to write **concurrent** code using
**async/await** syntax.