Bitpacked Data

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Sun Mar 11 18:42:35 EDT 2007


none wrote:

> i need to interface python with a bitpacked data file,
> the structure recorded in the file is the following:
> 
> struct {
> var_1 4bit
> var_2 6bit
> var_3 2bit
> var_3 4bit
> }

Strange data types. What language is this?
 
> how can read the struct and convert data into dictionary

I'd use the module struct, with bit shifting operators to extract
the bits.


Regards,


Björn

-- 
BOFH excuse #232:

Ionization from the air-conditioning




More information about the Python-list mailing list