python alternatives to C structs??

Wojtek Walczak gminick at bzt.bzt
Sat Apr 18 21:46:08 CEST 2009


On Sat, 18 Apr 2009 12:25:29 -0700 (PDT), KoolD wrote:

Hi,

> I need to convert a C code to python please help me figure out how to
> do
> it.
> Suppose the C program's like:
...
> Is there a way to code it in python.

You need struct module:
http://docs.python.org/library/struct.html
http://www.doughellmann.com/PyMOTW/struct/index.html
http://code.activestate.com/recipes/498149/

HTH,
-- 
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/



More information about the Python-list mailing list