readline python module does not work with aioconsole.ainput

Viewed 394

The following code accepts input from terminal and echo it back:

import readline
import asyncio
import aioconsole

async def input_coro():
    while True:
        from_user = await aioconsole.ainput('> ')
        from_user = from_user.strip()
        print(from_user)

if __name__ == "__main__":
  asyncio.get_event_loop().run_until_complete(input_coro())

However import readline has not effect here, meaning using up/down arrows to go through the command line history does not work.

How can I get the readline functionality with aioconsole.ainput ?

0 Answers
Related