Escapes???

Duncan Booth duncan at rcp.co.uk
Mon Jun 5 07:41:37 EDT 2000


aahz at netcom.com (Aahz Maruch) wrote in
<8h8qqs$l5a$1 at slb6.atl.mindspring.net>: 
>Ah.  Python appears to allow three-digit hex numbers.  I guess you'll
>have to paste the string together, character by character.

The best way to avoid problems with hex escapes is to use string
concatenation. Unless you know that the following character is safe, you
should always follow each hex escape with "". So "\x1b""a" will give you
the desired effect. (Or use single quotes if you prefer: '\x1b''a'). 



More information about the Python-list mailing list