raw string from mmap.read() possible?

David M. Wilson dw-google.com at botanicus.net
Mon Nov 10 00:49:35 CET 2003

Dan Jones <djones at shcorp.com> wrote in message news:<mailman.582.1068402358.702.python-list at python.org>...

> rgbframe = yuv.yuv2rgb(WIDTH, HEIGHT, "\0\0\0\0")
> but if I send it a raw string it doesn't complain:
> rgbframe = yuv.yuv2rgb(WIDTH, HEIGHT, r"\0\0\0\0")
> I'm assuming this is happening because C interprets NULL as the end of
> the string. Is there a way to get a raw string directly from the
> mmap.read() call or do I have to do a conversion after the read?

I think you're suffering from a little confusion here:

   "\0\0\0\0" results in the byte sequence:

   00 00 00 00

   r"\0\0\0\0" results in the byte sequence:

   5c 30 5c 30 5c 30 5c 30

This of course doesn't solve your problem, I know nothing about
imaging in python. :P



More information about the Python-list mailing list