TypeError: An asyncio.Future, a coroutine or an awaitable is required
异步时发现一只在报这个错,网上找了些方法,发现并不管用,于是仔细检查,发现
方法前面少了async
完整异步:
async def ExportData(v,f_row,a):
........
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
t1 = time.time()
# for v in a[1:]:
tasks = [ExportData(v,f_row,a) for v in a[1:]]
loop.run_until_complete(asyncio.gather(*tasks))