From 33ed1605b95d1406597977b601f6bc1062be14d8 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Mon, 17 Sep 2018 18:09:35 -0400 Subject: [PATCH] bpo-33649: Add a hello world example to asyncio.rst --- Doc/library/asyncio.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst index 7895826c65a064..73b0e63a68dbe7 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.