Guaranteeing an n-byte data type?

Evan Jones chardish at
Fri Jan 9 19:12:18 CET 2009

On Fri, Jan 9, 2009 at 11:56 AM, Grant Edwards <invalid at invalid> wrote:

> In addition to previous suggestions, you should look at the
> "struct" and "ctypes" modules in the standard Python library.
> Both allow you to pack/unpack data to/from data structures with
> arbitrary layout and endianness.
Thank you, everyone. struct appears to be exactly what I want; combined with
MRAB's insight into how socket.send() works, I feel I should be able to code
this in at around 25% the length of equivalent C code.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list