import asyncio async def task_successful(): pass if __name__ == \'__main__\': loop = asyncio.get_event_loop() task = loop.create_task(task_successful())