Application that prints to STDOUT and STDERR



examples/pytest/greet.py
import sys

def welcome(to_out, to_err=None):
    print(f"STDOUT: {to_out}")
    if to_err:
        print(f"STDERR: {to_err}", file=sys.stderr)

examples/pytest/use_greet.py
from greet import welcome

welcome("Jane", "Joe")
print('---')
welcome("Becky")

STDERR: Joe
STDOUT: Jane
---
STDOUT: Becky