TP <[EMAIL PROTECTED]> writes: > Peter Pearson wrote: > > > When you tell python "print '\033[30;44m foo \033[0m'", python > > interprets the "\033" as a single character. > > So, the python print command *can* interpret these 4-character as a > single character.
Not "interpret", no. It's more accurate to say that the Python *compiler* will translate "\033" within a string literal into a single character in the compiled executable byte code. That is, the input to the Python interpreter will not have "\033" in the string literal at all, but instead a single character produced by the Python compiler at that point in the byte code. > It would be odd if there were no possibility to do the same thing > when the characters are (i) stored in a python variable, or (ii) > come from the environment variables. Since those are not the input to the Python compiler, they can't be translated this way. -- \ “You know I could rent you out as a decoy for duck hunters?” | `\ —Groucho Marx | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list