Need help with struct module

Richard Brodie R.Brodie at rl.ac.uk
Thu Oct 2 10:20:29 EDT 2003


"Gordon Scott" <gscott2112 at hotmail.com> wrote in message
news:D1Web.6875$YO5.4091894 at news3.news.adelphia.net...

> why in this example are the packing of 9 and 10 not showing '\x00\x09' and
> '\x00\x0a' respectively?

It's the canonical representation of that string, after round tripping the
escaping/unescaping. No different to:
>>> ('\x41')
'A'

> On the target device when I read the file into a memory buffer and examine
> the contents, the value of 10 ('\x00\n') that I am expecting is litterally 00 0D
> and NOT 00 0A.

I guess at some point you've read/written/transferred the file without the binary flag.
Try dumping the file on each platform to see where it got converted. Then go back
and add a few '\x62's.






More information about the Python-list mailing list