Subject: RE: ANSI escapes in Python with Cygwin
From: "Kevin Wright" <[email-masked]>
To: <[email-masked]>
Cc: "Gilles Lenfant" <[email-masked]>
Date: Sun, 18 Feb 2001 16:13:09 -0700

Gilles,

This test works ok for me. Which version of python are you using?
Was it built under cygwin? If not, you should build it for cygwin.
Search the mailing list on how to do this.

Python 2.0 (#2, Jan 15 2001, 14:22:08)
[GCC 2.95.2-6 19991024 (cygwin experimental)] on cygwin_nt-4.01
Type "copyright", "credits" or "license" for more information.
>>> RED = chr(27) + '[31m'
>>> print RED + 'hello world in red'
hello world in red

HTH,

--Kevin

> -----Original Message-----
> From: [email-masked]
> [mailto:[email-masked]]On Behalf Of Gilles Lenfant
> Sent: Sunday, February 18, 2001 4:28 PM
> To: [email-masked]
> Subject: ANSI escapes in Python with Cygwin
>
>
> 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
>
>

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