MinDalle_StableDiff/Python310/Lib/test/test_asyncio/echo3.py

12 lines
276 B
Python
Raw Permalink Normal View History

2022-09-17 15:26:13 +03:00
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'))