Miki wrote, on 03/03/2008 11:14 PM: > Hello Michael, > >> I'm trying to print out text in color. As far as I know, curses is the >> only way to do that (or not?). > On unix, every XTerm compatible terminal will be able to display color > using escape sequence. > (Like the one you see in the output of 'grep --color') > > See the shameless plug in > http://pythonwise.blogspot.com/2008/03/ansiprint.html > The escape sequence approach is definitely interesting and I'd prefer it to curses if I can make it work. However, I ultimately would like to support other terminals than xterm (especially Windows), that I assume have different ANSI codes. So, two questions: What are the most common terminals that differ in the ANSI codes they use, and how can I detect which of those terminals the program is running on? Where can I find out what codes those terminals use for color?
Michael. -- http://mail.python.org/mailman/listinfo/python-list