How do I print out in the standard output coloured lines

Bart Van Loon bbbart at inGen.be
Fri Feb 2 08:08:21 EST 2007


It was 2 Feb 2007 04:27:06 -0800, when cniharral at gmail.com wrote:

> print "Hello World!!"
>
> I want it in red colour.
>
> That's all.

Use colour escape codes:

print "\033[1;31mHello World\033[0m"

That's all. :-)

-- 
groetjes,
BBBart

   Golly, I'd hate to have a kid like me!
			  -- Calvin



More information about the Python-list mailing list