Closed Jack012a closed 1 year ago
I'd say the same as for sync writes:
async with aiofiles.open('test.txt', mode='w') as f:
await f.write(msg + '\n')
I see. Since the msg is very large. I will use the following instead.
async with aiofiles.open('test.txt', mode='w') as f:
await f.write(msg)
await f.write('\n')
That works too, if you want to avoid a copy of the data.
What is the best practice to write a new line for each written msg?
Thank you