On Aug 5, 10:46 am, "Martin P. Hellwig"
wrote:
> Hi List,
>
> On several occasions I have needed (and build) a parser that reads a
> binary piece of data with custom structure. For example (bogus one):
>
> BE
> +-+-+-+-+--++
> | Version | Command
On Thursday 06 August 2009 20:50:30 Martin P. Hellwig wrote:
> Thanks all for your insights and suggestions.
> It seems to me that there are a couple of ways to this bit manipulation
> and a couple of foreign modules to assist you with that.
>
> Would it be worth the while to do a PEP on this?
> Pe
Thanks all for your insights and suggestions.
It seems to me that there are a couple of ways to this bit manipulation
and a couple of foreign modules to assist you with that.
Would it be worth the while to do a PEP on this?
Personally I think that it would be nice to have a standard module in
On Aug 5, 3:46 pm, "Martin P. Hellwig"
wrote:
> Hi List,
>
> On several occasions I have needed (and build) a parser that reads a
> binary piece of data with custom structure. For example (bogus one):
>
> BE
> +-+-+-+-+--++
> | Version | Command
On Wednesday 05 August 2009 21:41:26 Martin P. Hellwig wrote:
> Yes you are (of course) right, my 'dream' solution would be something
> that accepts slice indeces on bit level. Your reasoning did reveal some
> flaws in my approach though ;-)
This is the first time I have been compared to the sand
On Wednesday 05 August 2009 20:12:05 Paul Rubin wrote:
> "Martin P. Hellwig" writes:
> > what I usually do is read the packet in binary mode, convert the
> > output to a concatenated 'binary string'(i.e. '0101011000110') and
>
> Something wrong with reading the data words as an integer and using
>
On Wednesday 05 August 2009 16:46:13 Martin P. Hellwig wrote:
> Hi List,
>
> On several occasions I have needed (and build) a parser that reads a
> binary piece of data with custom structure. For example (bogus one):
>
> BE
> +-+-+-+-+--++
>
> | V
Paul Rubin wrote:
"Martin P. Hellwig" writes:
Is there an advantage using shifts and masks over my kitchen type solution?
Weren't you complaining about the 8-to-1 expansion from turning each bit
to an ascii char?
One warning to Martin:
If you want your code portable across syste
En Wed, 05 Aug 2009 11:46:13 -0300, Martin P. Hellwig
escribió:
On several occasions I have needed (and build) a parser that reads a
binary piece of data with custom structure. For example (bogus one):
BE
+-+-+-+-+--++
| Version | Command
"Martin P. Hellwig" writes:
> Is there an advantage using shifts and masks over my kitchen type solution?
Weren't you complaining about the 8-to-1 expansion from turning each bit
to an ascii char?
--
http://mail.python.org/mailman/listinfo/python-list
On 5 Aug, 20:41, "Martin P. Hellwig"
wrote:
> Paul Rubin wrote:
> > "Martin P. Hellwig" writes:
> >> Is there an advantage using shifts and masks over my kitchen type solution?
>
> > Weren't you complaining about the 8-to-1 expansion from turning each bit
> > to an ascii char?
>
> Yes you are (of
Paul Rubin wrote:
"Martin P. Hellwig" writes:
Is there an advantage using shifts and masks over my kitchen type solution?
Weren't you complaining about the 8-to-1 expansion from turning each bit
to an ascii char?
Yes you are (of course) right, my 'dream' solution would be something
that ac
Paul Rubin wrote:
"Martin P. Hellwig" writes:
what I usually do is read the packet in binary mode, convert the
output to a concatenated 'binary string'(i.e. '0101011000110') and
Something wrong with reading the data words as an integer and using
old fashioned shifts and masks to get at the bi
"Martin P. Hellwig" writes:
> what I usually do is read the packet in binary mode, convert the
> output to a concatenated 'binary string'(i.e. '0101011000110') and
Something wrong with reading the data words as an integer and using
old fashioned shifts and masks to get at the bit fields?
--
http
On 5 Aug 2009, at 19:17 , Bearophile wrote:
Have you tried Hachoir? (I think its name may be changed to Fusil, I
don't know).
Name hasn't been changed (I think fusil is a subproject, something
like that) on the other hand the hachoir.org site is dead.
But apparently Hachoir was moved to bitbu
On 5 Aug 2009, at 16:46 , Martin P. Hellwig wrote:
Hi List,
On several occasions I have needed (and build) a parser that reads a
binary piece of data with custom structure. For example (bogus one):
BE
+-+-+-+-+--++
| Version | Command | Ins
Martin P. Hellwig:
> On several occasions I have needed (and build) a parser that reads a
> binary piece of data with custom structure. For example (bogus one):
>
> BE
> +-+-+-+-+--++
> | Version | Command | Instruction | Data Length | Data | Fill
Jon Clements wrote:
IIRC (and I have my doubts) the BitVector module may be of use, but
it's been about 3 years since I had to look at it. I think it used the
C equiv. of short ints to do its work. Otherwise, maybe the array
module, the struct module or even possibly ctypes.
Not much use, but m
On 5 Aug, 15:46, "Martin P. Hellwig"
wrote:
> Hi List,
>
> On several occasions I have needed (and build) a parser that reads a
> binary piece of data with custom structure. For example (bogus one):
>
> BE
> +-+-+-+-+--++
> | Version | Command |
Hi List,
On several occasions I have needed (and build) a parser that reads a
binary piece of data with custom structure. For example (bogus one):
BE
+-+-+-+-+--++
| Version | Command | Instruction | Data Length | Data | Filler |
+-+-
20 matches
Mail list logo