aioconsole provides asynchronous equivalents to built-in functions like input(), print(), and exec() for use within asyncio applications. It includes an interactive loop for running an asynchronous Python console and a script (apython) to access asyncio code at runtime. The library is actively maintained, with regular updates to support newer Python versions.
pip install aioconsoleVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic asynchronous input and output using `ainput` and `aprint`. Run this script and type in the console when prompted.
Upgrade your Python environment to 3.8 or newer.
Evaluate if a more powerful async-compatible REPL or prompting library better suits your advanced interactive needs.
Ensure you are using aioconsole v0.7.1 or newer for more robust handling of standard stream protection.
pip install aioconsole
Ensure you have the latest version of 'aioconsole' installed: pip install --upgrade aioconsole
Run 'apython' directly from the command line, not as an import in Python.
Use 'await' when calling asynchronous functions: result = await aioconsole.ainput('Prompt: ')Use 'await' directly in interactive environments or manage the event loop appropriately in scripts.