[Q] Printing color strings on stdout without using escape sequences ?

Walter Dörwald walter at livinglogic.de
Fri Nov 16 20:41:17 CET 2001


Ivan DUTKA-MALEN wrote:

> Hello,
> 
> for my application to be a bit more friendly, I want to show some 
> colored strings on the standard output but I don't want to use ugly 
> escape sequence like '\033[1m;' or so...
> 
> I'd prefer use a module (if one exists) that encapsulate all those 
> things and that allows me to be portable on various Unix-like systems 
> (especialy Linux, Solaris, HP-UX, IRIX).
> Does anyone know such a module ?
> 
> For information, I tried to use curses but I think it doesn't make what 
> I want in the sense that it uses the full screen and I just want to use 
> the standard output stream. I may be wrong and I surely misuse it. Some 
> help will be much appreciated :-)).


You might want to take a look at ANSIStyle:
http://www.livinglogic.de/Python/ansistyle/

HTH,
   Walter Dörwald





More information about the Python-list mailing list