diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2023-12-17 10:46:40 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2023-12-17 10:46:40 +0000 |
commit | 4e61276ae3a4432a9d7a65dd49eb6ae71dd5f93a (patch) | |
tree | 57f9ac8ea7edafc3db4db312b8a369ab39711636 /README.rst | |
parent | Adding upstream version 3.0.23. (diff) | |
download | ptpython-4e61276ae3a4432a9d7a65dd49eb6ae71dd5f93a.tar.xz ptpython-4e61276ae3a4432a9d7a65dd49eb6ae71dd5f93a.zip |
Adding upstream version 3.0.25.upstream/3.0.25
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'README.rst')
-rw-r--r-- | README.rst | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -71,6 +71,7 @@ The help menu shows basic command-line options. -h, --help show this help message and exit --vi Enable Vi key bindings -i, --interactive Start interactive shell after executing this file. + --asyncio Run an asyncio event loop to support top-level "await". --light-bg Run on a light background (use dark colors for text). --dark-bg Run on a dark background (use light colors for text). --config-file CONFIG_FILE @@ -171,6 +172,20 @@ error. .. image :: https://github.com/jonathanslenders/ptpython/raw/master/docs/images/validation.png +Asyncio REPL and top level await +******************************** + +In order to get top-level ``await`` support, start ptpython as follows: + +.. code:: + + ptpython --asyncio + +This will spawn an asyncio event loop and embed the async REPL in the event +loop. After this, top-level await will work and statements like ``await +asyncio.sleep(10)`` will execute. + + Additional features ******************* |