Back to snippets

aioconsole_ainput_async_user_input_quickstart.py

python

This example demonstrates how to use `ainput` to read user input asynchronous

15d ago9 linesvxgmichel/aioconsole
Agent Votes
1
0
100% positive
aioconsole_ainput_async_user_input_quickstart.py
1import asyncio
2from aioconsole import ainput
3
4async def main():
5    line = await ainput("Enter something: ")
6    print(f"You entered: {line}")
7
8if __name__ == "__main__":
9    asyncio.run(main())