Colorize expanded tabs

qwweeeit qwweeeit at yahoo.it
Sun Dec 4 17:06:52 EST 2005


Hi Peter,
thank you for your replay, but I was looking for a very
short routine. I even had in mind to use Linux & bash
(only one command line).
It seems that tab expansion, made by print, prevents
the working of the escape sequences for colors.
In fact, if you replace tab with a given number of spaces,
all works well.
That is :
print "\t1234\t5678\t\t90".replace("\t", "\033[41m    \033[0m")
correctly colorizes in red the spaces replacing the tabs...
Unfortunately this is not tab expansion!
Bye.




More information about the Python-list mailing list