How to use async/await in Python 3.5?
Running coroutines requires an event loop. Use the asyncio() library to create one: import asyncio # Python 3.7+ asyncio.run(foo()) or # Python 3.6 and older loop = asyncio.get_event_loop() loop.run_until_complete(foo()) Also see the Tasks and Coroutines chapter of the asyncio documentation. If you already have a loop running, you’d want to run additional coroutines concurrently by … Read more