On Sun, Aug 30, 2009 at 11:59 AM, Skipper Seabold wrote:
> Hello all,
>
> Fair warning, I didn't know what a bitfield was a few hours ago.
>
> I am working with a program via the dbus module and I am wondering if
> there is built-in support to deal with bitfields in Python. I query
> my applicatio
On Sun, Aug 30, 2009 at 1:58 PM, Alan Gauld wrote:
>
> "Skipper Seabold" wrote
>
>> You can just do a binary AND with your consts and your bitfield value to
>> get
>> > each bit. The values will be the actual value (2, 4, 8, etc.) but if >
>> > you
>> > use these as a boolean it won't matter.
>> N
"Skipper Seabold" wrote
You can just do a binary AND with your consts and your bitfield value to
get
> each bit. The values will be the actual value (2, 4, 8, etc.) but if
> you
> use these as a boolean it won't matter.
No that's perfect. It looks like I need to read up a bit more (pun
not
You can just do a binary AND with your consts and your bitfield value to get
each bit. The values will be the actual value (2, 4, 8, etc.) but if you
use these as a boolean it won't matter.I.E.
>>> bitfield = 119
>>> seek = bitfield & CAN_SEEK
>>> seek
16
>>> if seek:
print "Hello"
Hello
>>>
if
On Sun, Aug 30, 2009 at 1:25 PM, Luke
Paireepinart wrote:
> You can just do a binary AND with your consts and your bitfield value to get
> each bit. The values will be the actual value (2, 4, 8, etc.) but if you
> use these as a boolean it won't matter.
> I.E.
bitfield = 119
seek = bitfi
Hello all,
Fair warning, I didn't know what a bitfield was a few hours ago.
I am working with a program via the dbus module and I am wondering if
there is built-in support to deal with bitfields in Python. I query
my application and it returns a bitfield 119. The bitfield "key" is
NONE