asyncio server and client to handle input from console
You could consider using aioconsole.ainput:
from aioconsole import ainput
async def some_coroutine():
line = await ainput(">>> ")
[...]
The project is available on PyPI.
another way is just to use run_in_executor
so something like
from functools import partial
from concurrent.futures.thread import ThreadPoolExecutor
async def f():
rie = partial(asyncio.get_event_loop().run_in_executor, ThreadPoolExecutor(1))
while True:
await rie(input)