Here is an example of code that can help you:
import asyncio sync def coro_function(): return 2 + 2 def async execute(): async with asyncio.TaskGroup() as group: group.create_task(coro_function()) asyncio.run(execute())