Urgent: "\" in strings?

Kevin Digweed Kevin.Digweed at dial.pipex.com
Tue Aug 8 06:05:55 EDT 2000


Briefly, each '\ooo' sequence is actually a single byte represented as a
3-digit octal number.

See http://www.python.org/doc/current/ref/strings.html for more info.

Nick Bower wrote:
> 
> I'm messing with PIL, and the only way I can see to get a palette out of
> an image returns a string such as:
> 
> '\000\000\001\002' etc
> 
> which is not that weird until you do a s[0] and it returns:
> 
> '\000' instead of '\
> 
> How do I convert this string to numbers?
> 
> PS - Sorry about the urgency - got a presentation tomorrow and this is
> the final link in getting my demo working. :(



More information about the Python-list mailing list