print syntax-coloring -python question-

Hey guys, I was wounding if python or a panda work around exist to print text out in color for the console screen?

something like:

print '\033[0;31mtesttest\033[m'

?
well i guess it’s possible by simpliy adding the color-codes for the console.
windows might be different again. afaik there is no convenient to use print(“yourstring”,color) yet. you might aswell write one.

Sorry that doesnt work for windows nt+ base I dont think. (MS-DOS only?)

Yea, not having much luck finding a way either. Guess i’ll have to either setup some built in concole screen or read more about ANSI.SYS when I can.

in windows there’s that ‘color’ shell builtin. type

color /help

or

color /?

or something like that into a windows shell to see more details about that. you could simply call that comand from python before and after each print (function decorators may help, dunno)

Cause color command does everything in that color not just a word or a line. From what I found out, windows inself doesnt have the command to color the words anymore. Or the cmd shell doesnt anyways. So for a work around it looks like i’ll have ot use the DOS shell or some other shell. Unless someone found another way I didn’t find on the net.