Rename output -> stdout, add stderr.

This commit is contained in:
voussoir 2020-12-07 20:08:39 -08:00
parent 0a1a3a545e
commit 6873beb823

View file

@ -130,12 +130,21 @@ def input(
continue
yield line
def output(line, end='\n'):
sys.stdout.write(line)
def _output(stream, line, end):
stream.write(line)
if not line.endswith(end):
sys.stdout.write(end)
stream.write(end)
if not OUT_PIPE:
sys.stdout.flush()
stream.flush()
def stdout(line, end='\n'):
_output(sys.stdout, line, end)
def stderr(line, end='\n'):
_output(sys.stderr, line, end)
# backwards compat
output = stdout
def go(args=None, *input_args, **input_kwargs):
'''