struct module...

Franck Bui-Huu Franck.BUI-HUU at gemplus.com
Fri Mar 21 05:46:20 EST 2003


Hey

I'm trying to read from a binary file data.
These data have been written by a C soft using structure like
struct xxx {
    u1 length;
    u1 array[length];
}
Use of pascal string format is quite useless because you have
to know the length of the string that you want to unpack.

did someone extend struct module to manage not fixed lengh of
array. We could imagine a format for struct xxx like:
'B?(1)c' where ?(1) means the value of the first unpcked data.

Thanks

Franck






More information about the Python-list mailing list