Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install termstyle

How to install termstyle

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install termstyle
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.5 Available View build log
Windows (64-bit)
0.1.5 Available View build log
Mac OS X (10.5+)
0.1.5 Available View build log
Linux (32-bit)
0.1.5 Available View build log
Linux (64-bit)
0.1.5 Available View build log
 
License
BSD
Dependencies
Depended by
Imports
Lastest release
version 0.1.5 on Jan 5th, 2011

termstyle is a simple python library for adding coloured output to terminal (console) programs. The definitions come from ECMA-048, the "Control Functions for Coded Character Sets" standard.

Installation:

System Message: WARNING/2 (<string>, line 11)

Literal block expected; none found.

easy_install termstyle

or from source:

./setup.py bdist_egg

System Message: ERROR/3 (<string>, line 16)

Inconsistent literal block quoting.

cp dist/termstyle-*.egg <path-to-your-python-libraries>

System Message: WARNING/2 (<string>, line 16); backlink

Inline emphasis start-string without end-string.

Example Usage:

System Message: WARNING/2 (<string>, line 22)

Literal block expected; none found.

from termstyle import * print "%s:%s" % (red('Hey'), green('how are you?')) print blue('How ', bold('you'), ' doin?')

or, you can use a colour just as a string:

System Message: WARNING/2 (<string>, line 28)

Literal block expected; none found.

print "%sBlue!%s" % (blue, reset)

Styles:

System Message: WARNING/2 (<string>, line 34)

Literal block expected; none found.

reset or default (no colour / style)

colour:

System Message: WARNING/2 (<string>, line 38)

Literal block expected; none found.

black red green yellow blue magenta cyan white

background colour:

System Message: WARNING/2 (<string>, line 49)

Literal block expected; none found.

bg_black bg_red bg_green bg_yellow bg_blue bg_magenta bg_cyan bg_white bg_default

In terminals supporting transparency bg_default is often used to set the background to transparent [1].

weight:

System Message: WARNING/2 (<string>, line 64)

Literal block expected; none found.

bold inverted

style:

System Message: WARNING/2 (<string>, line 69)

Literal block expected; none found.

italic underscore

Controls:

System Message: WARNING/2 (<string>, line 76)

Literal block expected; none found.

auto() - sets colouring on only if sys.stdout is a terminal disabe() - disable colours enable() - enable colours

[1]Supporting terminals include rxvt-unicode, and Eterm.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.