Closed britisharmy closed 4 years ago
I have this non async method
def lastname(): with open('surnames.csv') as csvfile: readCSV = csv.reader(csvfile, delimiter=',') for row in readCSV: print(row[0],row[1])
that reads a row
and i have this async
async def firstname(): async with aiofiles.open('firstnames.csv') as csvfile: readCSV = await csvfile.read() return readCSV
How can i read a row in the async method?
@britisharmy do you read the REAME:
Asynchronous iteration is also supported. async with aiofiles.open('filename') as f: async for line in f: ...
Asynchronous iteration is also supported.
async with aiofiles.open('filename') as f: async for line in f: ...
I have this non async method
that reads a row
and i have this async
How can i read a row in the async method?