[Python-checkins] bpo-33649: Add a hello world example to asyncio.rst (GH-9374)
Yury Selivanov
webhook-mailer at python.org
Mon Sep 17 18:42:04 EDT 2018
https://github.com/python/cpython/commit/3085534c398e6b181e7a9ac0cb9c80f3c670f2b9
commit: 3085534c398e6b181e7a9ac0cb9c80f3c670f2b9
branch: master
author: Yury Selivanov <yury at magic.io>
committer: GitHub <noreply at github.com>
date: 2018-09-17T18:41:59-04:00
summary:
bpo-33649: Add a hello world example to asyncio.rst (GH-9374)
files:
M Doc/library/asyncio.rst
diff --git a/Doc/library/asyncio.rst b/Doc/library/asyncio.rst
index 7895826c65a0..73b0e63a68db 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.
More information about the Python-checkins
mailing list