Ross Ridge rrid...lub.uwaterloo.ca wrote:
Unfortunately from your other posts you do seem to be working on
a single byte a time, so my technique probably won't be efficient.
Its a bit more - the hardware allows for 64 lines in and 64 lines out.
You probably want just want to be using
Aaron \Castironpi\ Brady wrote:
This is tolerable. Â If you've got a better 'clear' operation than
'xor', you're welcome to it.
*grin* xor is a toggle bit fuction, and I did not like the recursive
call in your code. so here is a module bsed on your BitSet:
(I hope my tabs survive the journey)
Ross Ridge wrote:
This is the code I use to convert large bit arrays to byte strings and
back:
import string
import binascii
import array
8--- examples --
I don't think you can do anything faster with standard modules, although
it might not be efficient if
Lie Li...mail.com wrote:
This of course means that there has to be another
thread active to actually do the i/o on a periodic basis,
gathering the outputs and writing them out, and reading
the inputs and scattering them to the various named input
bits
Not necessarily. You've mentioned two
Ross Ridge wrote:
I don't think you can do anything faster with standard modules, although
it might not be efficient if you're only working with a single byte.
Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Thanks I was not aware of binascii module this looks powerful.
Not really. It's just used
Tino Wildenhain wrote:
byte1 byte2? this does not look very practical
to me. In the simplest form of storing
your values in a text string, you could just
use ord() to get the byte value and
operate on it with 10 11 13 and so on.
If you want, put a module in which defines the
George Sakkis wrote:
I don't know of a canonical way (bit hacking is not really common in
Python) but pehaps BitPacket [1] comes close to what you're after.
George
[1] http://hacks-galore.org/aleix/BitPacket/
Thanks for the link - I will check it out
- Hendrik
--
Mensanator wrote:
I use the gmpy module for all my bit related work and
have been very satisfied with the results.
8--- gmpy function list ---
Thanks. All of this looks good. Will check out
gmpy too.
- Hendrik
--
Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
ints that represent bits into one of the bytes in some
array or string or whatever?
This is the code I
Hendrik van Rooyen wrote:
Tino Wildenhain wrote:
byte1 byte2? this does not look very practical
to me. In the simplest form of storing
your values in a text string, you could just
use ord() to get the byte value and
operate on it with 10 11 13 and so on.
If you want, put a module in which
Lie Ryan wrote:
You'll find that in most cases, using integer or Boolean is enough. There
are some edge cases, which requires bit addressing for speed or memory
optimizations, in python, the usual response to that kind of optimization
requirement is to move that part of the code to C.
If, for
Tino Wildenhain wrote:
Hendrik van Rooyen wrote:
Tino Wildenhain wrote:
8
Sure, one could for instance make a list of eight-entry lists:
io = [[b0,b1,b2,b3,b4,b5,b6,b7],]
what should that represent? Which byte order
do you have in mind etc?
Each
On Oct 11, 5:27 am, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
This of course means that there has to be another
thread active to actually do the i/o on a periodic basis,
gathering the outputs and writing them out, and reading
the inputs and scattering them to the various named input
bits
On Oct 11, 5:27 am, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
This of course means that there has to be another
thread active to actually do the i/o on a periodic basis,
gathering the outputs and writing them out, and reading
the inputs and scattering them to the various named input
bits
On Oct 9, 5:30 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
ints that represent bits into one of the bytes in some
array or string or
On Oct 10, 10:37 pm, Aaron \Castironpi\ Brady
[EMAIL PROTECTED] wrote:
On Oct 9, 5:30 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
ints that represent bits into one of the bytes in some
array or string or whatever?
It seems to me that there is a dilemma here :
if you can
Hi,
Hendrik van Rooyen wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
ints that represent bits into one of the bytes in some
array or string or whatever?
It seems to me that there is
On Fri, 10 Oct 2008 00:30:18 +0200, Hendrik van Rooyen wrote:
Is there a canonical way to address the bits in a structure like an
array or string or struct?
Or alternatively, is there a good way to combine eight ints that
represent bits into one of the bytes in some array or string or
On Oct 9, 6:30 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
I don't know of a canonical way (bit hacking is not really common in
Python) but pehaps BitPacket [1] comes close to what you're after.
On Oct 9, 5:30 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote:
Is there a canonical way to address the bits in a structure
like an array or string or struct?
Or alternatively, is there a good way to combine eight
ints that represent bits into one of the bytes in some
array or string or
21 matches
Mail list logo