Browse Source

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

pull/9376/head
Yury Selivanov 8 years ago
committed by GitHub
parent
commit
3085534c39
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      Doc/library/asyncio.rst

13
Doc/library/asyncio.rst

@ -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.

Loading…
Cancel
Save