python - Creating a custom format type in Struct -
i trying decode binary data socket connection python datatypes (ints, floats, etc) using struct. works fine +90% of cases. problem few of binary streams contain non-standard data types (e.g. 6 byte int).
what define custom datatype handle these cases. in following example, 'e' custom 6 byte int
the command
struct.unpack('heh', binary_data)
would yield:
(int_2b_var, int_6b_var, uint_2b_var)
how go this? thanks
Comments
Post a Comment