ANSI escapes in Python with Cygwin

Gilles Lenfant glenfant@e-pack.net
Sun Feb 18 15:25:00 GMT 2001


Hi,

Perhaps I missed something somewhere but...

I can make the same escape sequences to make color (bold...) text in Python
and Bash when under Linux.

This don't work with Cygwin: only bash ANSI escape sequences are equivalent
on Cygwin and Bash/Linux.

In example:

[bash]python

>>> RED = chr(27) + '[31m'
>>> print RED + 'hello world in red'
<-[31mhello world in red

The escape character is printed as a left arrow (1 character cell) and the
ANSI code is printed !
The color of the text does not turn to red.

Notes :

1/ I did not test the same in perl but I guess it should be identical.
2/ I tested this with both "official" binary distributions (1.5.2 and 2.0)
of Python for Windows.

Did I miss something or should I do something else to get it at work.

Thanks in advance for some light

Gilles Lenfant


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list