What's your choice when handle complicated C structures.

Daniel Fetchinson fetchinson at googlemail.com
Tue Nov 4 20:20:26 EST 2008


> Recently I am writing a small network application with python.
>
> The protocol is binary based and defined in c header files.
>
> Now I'm using the upack function of 'struct' module, but it's really
> annoying to write fmt strings for complicated structures.
>
> What will be your choice when handling binary structures?

I would write a couple of wrapper functions around unpack of struct so
that the actual unpacking is less annoying but otherwise would
continue using the same approach as what you describe.

Cheers,
Daniel
-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown



More information about the Python-list mailing list