snakeoil.struct_compat module¶
Minor struct enhancements, and python version compatibility implementations
In usage, instead of importing struct you should just import this module instead. It’s designed to be a drop in replacement.
- class snakeoil.struct_compat.Struct[source]¶
Bases:
StructStruct extension class adding read and write methods for handling files
- snakeoil.struct_compat.pack(format, v1, v2, ...) bytes¶
Return a bytes object containing the values v1, v2, … packed according to the format string. See help(struct) for more on format strings.
- snakeoil.struct_compat.unpack(format, buffer, /)¶
Return a tuple containing values unpacked according to the format string.
The buffer’s size in bytes must be calcsize(format).
See help(struct) for more on format strings.