5) print('taks {} begin. wait {} sec'.format(task_name, wait)) yield from asyncio.sleep(wait) print('taks {} end.'.format(task_name)) def main(): tasks = [wait_for(x) for x in range(3)] loop = asyncio.get_event_loop() loop.run_until_complete(asyncio.wait(tasks)) loop.stop() if __name__ == '__main__': main()