Asynchronous Console and Interfaces for asyncio

0.8.2 · active · verified Sat Apr 11

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.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates basic asynchronous input and output using `ainput` and `aprint`. Run this script and type in the console when prompted.

import asyncio
from aioconsole import ainput, aprint

async def main():
    await aprint("Enter your name:")
    name = await ainput("> ")
    await aprint(f"Hello, {name}!")

if __name__ == "__main__":
    asyncio.run(main())

view raw JSON →