» Main »
termstyle - console colouring for python
Published by Tim Cuthbertson
- Overview
This is a Zero Install feed. This software cannot be run as an application directly. It is a library for other programs to use.
For more information about Zero Install, see 0install.net.
- Full name
- Homepage
- Description
========= termstyle ========= 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: ------------- I thoroughly recommend using the zero-install feed (see the project homepage) to manage your dependencies if at all possible. zero-install_ provides a much better system than pip or easy_install, and works with absolutely any language and allows decentralised package management that requires no special privileges to install. Example Usage: -------------- :: 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:: print "%sBlue!%s" % (blue, reset) Styles: ------- :: reset or default (no colour / style) colour:: black red green yellow blue magenta cyan white background colour:: 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 [#]_. weight:: bold inverted style:: italic underscore Controls: --------- :: auto() - sets colouring on only if sys.stdout is a terminal disabe() - disable colours enable() - enable colours .. [#] Supporting terminals include rxvt-unicode_, and Eterm_. .. _ECMA-048: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf .. _rxvt-unicode: http://software.schmorp.de/ .. _Eterm: http://www.eterm.org/ .. _zero-install: http://0install.net/
- Available versions
The list below is just for information; Zero Install will automatically select one of these versions for you.
Version Released Stability Platform Download 0.1.5 2010-07-18 Any Download (3114 bytes) 0.1.6 2010-11-05 Any Download (3607 bytes) 0.1.7 2011-01-29 Any Download (4265 bytes) 0.1.8 2011-03-15 Any Download (4312 bytes) 0.1.9 2011-03-16 Any Download (2901 bytes) 0.1.10 2011-04-30 Any Download (2903 bytes) - Required libraries
This feed does not list any additional requirements.