From 3085534c398e6b181e7a9ac0cb9c80f3c670f2b9 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Mon, 17 Sep 2018 18:41:59 -0400 Subject: [PATCH] bpo-33649: Add a hello world example to asyncio.rst (GH-9374) --- Doc/library/asyncio.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index 7895826c65..73b0e63a68 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. -- 2.40.0