From: Sasha <nd...@ma...> - 2006-11-04 18:03:25
|
On 11/3/06, Torgil Svensson <tor...@gm...> wrote: > class struct_type(Structure): > _fields_ = [....] > > ... > ... which is somewhat static in nature. How do you create "structures" > dynamically? > You can put the above in a function that takes fields as an argument, or type('struct_type', (Structure,), {'_fields_':[('a', c_int), ('b', c_long)]}) |