interpretation of special characters in Python

TP Tribulations at Paralleles.invalid
Mon Jul 7 04:05:56 EDT 2008


TP wrote:

> So, the python print command *can* interpret these 4-character as a single
> character. It would be odd if there were no possibility to do the same
> thing when the characters are (i) stored in a python variable

Sorry, it works when using variables. Try for example:

col="[0;31m"
esc="\033"
colreset="[0m"
print esc + col + "foobar" + esc + colreset

-- 
TP (Tribulations Parallèles)

"Allez, Monsieur, allez, et la foi vous viendra." (D'Alembert).



More information about the Python-list mailing list