File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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+
174189Additional features
175190*******************
176191
You can’t perform that action at this time.
0 commit comments