Skip to content

Instantly share code, notes, and snippets.

@nmchenry01
Last active November 23, 2021 20:08
Show Gist options
  • Select an option

  • Save nmchenry01/9a21749c3f9370e79019b372b7973177 to your computer and use it in GitHub Desktop.

Select an option

Save nmchenry01/9a21749c3f9370e79019b372b7973177 to your computer and use it in GitHub Desktop.
A working example of running a coroutine
import asyncio
async def something_async():
# Wait 3 seconds
await asyncio.sleep(3)
return "Now we're cooking with fire!"
async def main():
result = await something_async()
print(result)
asyncio.run(main())
# Output:
#
# Now we're cooking with fire!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment