Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 6c06ef7dc310039361f931162857003548658cde authored by Ned Deily on 13 October 2018, 07:01:13 UTC
3.7.1rc2
Tip revision: 6c06ef7
echo3.py
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'))
back to top