diff options
author | Yury Selivanov <yury@magic.io> | 2018-09-17 22:41:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 22:41:59 (GMT) |
commit | 3085534c398e6b181e7a9ac0cb9c80f3c670f2b9 (patch) | |
tree | 7d5b0f521a65fc11393ed189d38e1847b5a9efd7 | |
parent | 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27 (diff) | |
download | cpython-3085534c398e6b181e7a9ac0cb9c80f3c670f2b9.zip cpython-3085534c398e6b181e7a9ac0cb9c80f3c670f2b9.tar.gz cpython-3085534c398e6b181e7a9ac0cb9c80f3c670f2b9.tar.bz2 |
bpo-33649: Add a hello world example to asyncio.rst (GH-9374)
-rw-r--r-- | Doc/library/asyncio.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index 7895826..73b0e63 100644 --- a/Doc/library/asyncio.rst +++ b/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. |