[Tutor] calculator

dman dsh8290@rit.edu
Tue, 28 Aug 2001 14:28:54 -0400


On Tue, Aug 28, 2001 at 02:16:17PM -0400, Andrei Kulakov wrote:
| On Tue, Aug 28, 2001 at 02:07:22PM -0400, Ignacio Vazquez-Abrams wrote:

| > As for coloured letters... if somebody's still using numbers in their menu,
| > then I doubt that they're ready for curses ;)
| 
| No need for 'em :-) Here's a lil function I cooked up:
| 
...
|         return "\033[%s\033[%s%s\033[0m" % (bg, fg, text)

Just FYI -- the escape codes don't work in all shells.  For example
with cygwin the default prompt has escape codes to colorize it.  They
look great in bash, but ash doesn't understand it and just displays
the escapes codes.

-D