import sys def print_err(*args, **kwargs): ''' print to stderr ''' print(*args, file=sys.stderr, **kwargs)