How can I decorate a function so that anything it prints to stdout is in green and anything it prints to stderr is in red<
stdout
stderr
This works for me in Bash in my Mac's Terminal.app
import sys green = '\033[01;32m' red = '\033[01;31m' sys.stdout.write(green+"Hello ") sys.stderr.write(red+"world!")