Closed dougransom closed 1 year ago
please include in the docs how to write to stdout. here is a snippent of how i did it , wrap isn't documented.
`import asyncio from email import contentmanager import aiohttp import aiofiles from aiofiles.os import wrap import sys import os
aio_write = aiofiles.os.wrap(os.write)
async def main(): async with aiofiles.open("sample.txt") as f:
write_stdout=wrap(sys.stdout.write) print_stdout=wrap(print) async for contents in f: await write_stdout(contents) #await print_stdout(f"stdout test")
asyncio.run(main())`
please include in the docs how to write to stdout. here is a snippent of how i did it , wrap isn't documented.
`import asyncio from email import contentmanager import aiohttp import aiofiles from aiofiles.os import wrap import sys import os
aio_write = aiofiles.os.wrap(os.write)
async def main(): async with aiofiles.open("sample.txt") as f:
contents=await f.read()
asyncio.run(main())`