Skip to content

Commit 96d621c

Browse files
Added info about top-level await to the README.
1 parent eb39a32 commit 96d621c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The help menu shows basic command-line options.
7171
-h, --help show this help message and exit
7272
--vi Enable Vi key bindings
7373
-i, --interactive Start interactive shell after executing this file.
74+
--asyncio Run an asyncio event loop to support top-level "await".
7475
--light-bg Run on a light background (use dark colors for text).
7576
--dark-bg Run on a dark background (use light colors for text).
7677
--config-file CONFIG_FILE
@@ -171,6 +172,20 @@ error.
171172
.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/validation.png
172173
173174
175+
Asyncio REPL and top level await
176+
********************************
177+
178+
In order to get top-level ``await`` support, start ptpython as follows:
179+
180+
.. code::
181+
182+
ptpython --asyncio
183+
184+
This will spawn an asyncio event loop and embed the async REPL in the event
185+
loop. After this, top-level await will work and statements like ``await
186+
asyncio.sleep(10)`` will execute.
187+
188+
174189
Additional features
175190
*******************
176191

0 commit comments

Comments
 (0)