Python, Data Science, Artificial Intelligence, Programming, Tips.
'http://example.com', 'http://example.org', 'http://example.net' ] tasks = [] for url in urls: task = asyncio.ensure_future(fetch(url)) tasks.append(task) results = await asyncio.gather(*tasks) for result in results: print(result) loop = asyncio.get_event_loop() loop.run_until_complete(main())