Skip to content

Commit

Permalink
Added info about top-level await to the README.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanslenders committed Dec 12, 2023
1 parent eb39a32 commit 96d621c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.rst
Expand Up @@ -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
Expand Down Expand Up @@ -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
*******************

Expand Down

0 comments on commit 96d621c

Please sign in to comment.