Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <008b01c09a02$64923750$2701a8c0@bettik>
From: "Gilles Lenfant" <glenfant@e-pack.net>
To: <cygwin@cygwin.com>
Subject: ANSI escapes in Python with Cygwin
Date: Mon, 19 Feb 2001 00:27:39 +0100
Organization: equod
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-Mimeole: Produced By Microsoft MimeOLE V5.50.4133.2400

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

