Why can I only use the await keyword inside of async function?

You can only use await in an async enviroment. Try changing the function to asnyc:

import asyncio


whatever = . . .

async def function(param) -> asyncio.coroutine:
  await param

asyncio.run(function(whatever))

Simple and easy.

Leave a Comment