Changing TEXT color from python

Grant Edwards grante at visi.com
Mon Apr 4 16:06:24 EDT 2005


On 2005-04-04, GujuBoy <dirgesh at gmail.com> wrote:

> so i am writing a program in Python and i want to print out a few
> statements in Different colors
>
> for example "Print hello world in RED, and "GOOD BYE in blue" "
>
> how can i do this...

Depends on what you're printing on.

tty?
    curses 
    os.popen('tput')

printer?    
    reportlab

> and hopefully without including any external modules.

I suppose you can pick an output device and hard-wire the
escape sequences into your code.

-- 
Grant Edwards                   grante             Yow!  SHHHH!! I hear SIX
                                  at               TATTOOED TRUCK-DRIVERS
                               visi.com            tossing ENGINE BLOCKS into
                                                   empty OIL DRUMS...



More information about the Python-list mailing list