File: echo3.py

package info (click to toggle)
aiozmq 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 688 kB
  • sloc: python: 7,225; makefile: 162
file content (9 lines) | stat: -rw-r--r-- 240 bytes parent folder | download
1
2
3
4
5
6
7
8
9
import os

if __name__ == "__main__":
    while True:
        buf = os.read(0, 1024)
        try:
            os.write(1, b"OUT:" + buf)
        except OSError as ex:
            os.write(2, b"ERR:" + ex.__class__.__name__.encode("ascii"))