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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -