Download cpython_2/environment/repo/Lib/test/test_asyncio/echo3.py from lolbench26/LoLBench: direct link, hf CLI and curl.
- Browser
- Download file 276 Bytes
-
https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Lib/test/test_asyncio/echo3.py
- Command line
-
hf download hf://datasets/lolbench26/LoLBench/cpython_2/environment/repo/Lib/test/test_asyncio/echo3.py
-
curl -L -o echo3.py https://huggingface.co/datasets/lolbench26/LoLBench/resolve/main/cpython_2/environment/repo/Lib/test/test_asyncio/echo3.py
276 Bytes
| import os | |
| if __name__ == '__main__': | |
| while True: | |
| buf = os.read(0, 1024) | |
| if not buf: | |
| break | |
| try: | |
| os.write(1, b'OUT:'+buf) | |
| except OSError as ex: | |
| os.write(2, b'ERR:' + ex.__class__.__name__.encode('ascii')) | |