for i in range(25): task=asyncio.ensure_future(getData(url.format(i+1),headers)) tasks.append(task) result = loop.run_until_complete(asyncio.gather(*task)) // 把task改为tasks就可以了
for i in range(25): task=asyncio.ensure_future(getData(url.format(i+1),headers)) tasks.append(task) result = loop.run_until_complete(asyncio.gather(*task)) // 把task改为tasks就可以了