delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/18/19:16:16

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
X-Sent: 19 Feb 2001 00:14:30 GMT
From: "Kevin Wright" <kevin AT wright DOT org>
To: <cygwin AT cygwin DOT com>
Cc: "Gilles Lenfant" <glenfant AT e-pack DOT net>
Subject: RE: ANSI escapes in Python with Cygwin
Date: Sun, 18 Feb 2001 16:13:09 -0700
Message-ID: <000501c09a00$5b99af90$7074aa40@holstein-mobile.ASPECTDV.COM>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
In-Reply-To: <008b01c09a02$64923750$2701a8c0@bettik>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3612.1700
Importance: Normal

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: cygwin-owner AT sources DOT redhat DOT com
> [mailto:cygwin-owner AT sources DOT redhat DOT com]On Behalf Of Gilles Lenfant
> Sent: Sunday, February 18, 2001 4:28 PM
> To: cygwin AT cygwin DOT com
> 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

- Raw text -


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