Re: Bitpacked Data

2007-03-12 Thread Nick Craig-Wood
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 > } > > how can read the struct and conv

Re: Bitpacked Data

2007-03-11 Thread Nick Vatamaniuc
On Mar 11, 5:49 pm, none <""luca\"@(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 > > } >

Re: Bitpacked Data

2007-03-11 Thread bearophileHUGS
Bjoern Schliessmann: > I'd use the module struct, with bit shifting operators to extract > the bits. Maybe Pyrex can be used to create a small module that can manage similar bitfields quickly and with a syntax not too much far from the Erlang bit syntax. Bye, bearophile -- http://mail.python.or

Re: Bitpacked Data

2007-03-11 Thread Bjoern Schliessmann
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 th

Bitpacked Data

2007-03-11 Thread none
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 } how can read the struct and convert data into dictionary Thnx -- http://mail.python.org/mailman/listinfo/python-list