[Tutor] string conversion

Robert Clement robert.clement at ed.ac.uk
Mon Feb 28 22:28:23 CET 2011


Hi

I have a wxpython control in which users are intended to enter control 
characters used to define binary string delimiters,  eg. '\xBA\xBA' or 
'\t\r\n' .

The string returned by the control is a unicode version of the string 
entered by the user, eg.  u'\\xBA\\xBA'  or  u'\\t\\r\\n' .

I would like to be able retrieve the original string containing the 
escaped control characters or hex values so that I can assign it to a 
variable to be used to split the binary string.

Does anyone know of a way this can be achieved?

Thanks
Rob



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Tutor mailing list