[Tutor] linux terminal coloring in python

Noufal Ibrahim noufal at airtelbroadband.in
Sun Sep 30 11:31:02 CEST 2007


Robert Jackson wrote:
> I'm trying to get some pretty colored output for a Linux console / terminal window.  Google searches only reveal the curses module to colorize output.
> 
> Is there a simpler way?  Curses seems to be FAR too powerful for what it is I want to do (simply to colorize a few 'print' outputs to the console).
> 

I stumbled across a recipe for a portable terminal colouring scheme here
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116

You need to use the curses module but don't need to put the terminal 
into raw mode etc.

Maybe it will suit your needs.

Peace
-- 
~noufal


More information about the Tutor mailing list