[Fwd: [Fwd: colorama : Simple cross-platform colored terminal text.]]

Alexander Belchenko bialix at ukr.net
Tue Apr 20 15:33:13 BST 2010


If we want cdiff working on windows, maybe it's worth to look at that 
project.

----- Forwarded message from Tartley <tartley at gmail.com> -----
Date: Mon, 19 Apr 2010 17:28:06 -0700 (PDT)
From: Tartley <tartley at gmail.com>
To: comp-lang-python-announce at moderators.isc.org
X-Original-To: python-announce at python.org
Reply-To: python-list at python.org
Newsgroups: comp.lang.python.announce
Subject: colorama : Simple cross-platform colored terminal text.
User-Agent: G2/1.0

ANSI escape character sequences are commonly used to produce colored
terminal text on Macs and Unix. Colorama makes these work on Windows
too.

It works by wrapping stdout and stderr on Windows, with proxies that
filter ANSI escape sequences out of printed text, and converting them
into equivalent win32 calls.

This has the happy side-effect that existing applications or libraries
which already use ANSI sequences to produce colored output on Linux or
Macs (eg. using packages like 'termcolor') will also work on Windows,
simply by calling Colorama.init().

I realise an alternative way to achieve the same result is to install
the ANSI.SYS device driver, but it is fiddly and intrusive for the
Python developer to do this on their machine of their application's
end-user.

This is the first release, and while it seems to work for me, no doubt
there are still many problems with it. Ruthless feedback is very
welcome, about both implementation and philosophy.

http://pypi.python.org/pypi/colorama
	



More information about the bazaar mailing list