Guaranteeing an n-byte data type?

Evan Jones chardish at gmail.com
Fri Jan 9 13:12:18 EST 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.

Cheers,
Evan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090109/68d84b07/attachment.html>


More information about the Python-list mailing list