delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/18/18:26:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <008b01c09a02$64923750$2701a8c0@bettik>
From: "Gilles Lenfant" <glenfant AT e-pack DOT net>
To: <cygwin AT cygwin DOT com>
Subject: ANSI escapes in Python with Cygwin
Date: Mon, 19 Feb 2001 00:27:39 +0100
Organization: equod
MIME-Version: 1.0
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019