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.
71
71
-h, --help show this help message and exit
72
72
--vi Enable Vi key bindings
73
73
-i, --interactive Start interactive shell after executing this file.
74
+ --asyncio Run an asyncio event loop to support top-level "await".
74
75
--light-bg Run on a light background (use dark colors for text).
75
76
--dark-bg Run on a dark background (use light colors for text).
76
77
--config-file CONFIG_FILE
@@ -171,6 +172,20 @@ error.
171
172
.. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/validation.png
172
173
173
174
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
+
174
189
Additional features
175
190
*******************
176
191
You can’t perform that action at this time.
0 commit comments