Shouldn't color should really be a parameter - unless the console only accepts a fixed set of colors?
I like the rest of it - using a 'with' block for indentation is clever.
from clint.textui.color import red, blue, green print "{0}, {1}, and {2}".format(red('red'), blue('blue'), green('green'))
print ColoredString("red", "some text")
printred = colored.print_function("red") printred("This prints in red")
print_function = lambda c: getattr(colored, c) printred = colored.print_function("red") printred("This prints in red")
Ruby has highline and colored, and perhaps some more too.
print colored('Hello, World!', 'red')
Shouldn't color should really be a parameter - unless the console only accepts a fixed set of colors?
I like the rest of it - using a 'with' block for indentation is clever.