On Sun, Aug 30, 2009 at 1:58 PM, Alan Gauld<[email protected]> wrote:
>
> "Skipper Seabold" <[email protected]> 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 intended) on the binary AND, but I think I see what it does and I
>> understand your example.
>
> You can go to the Using the OS topic in my tutorial for a quick tutoerial
> on how to extracts bits from a bitfield. There is a "sidebar" box entitled
> "Bitwise Operations and Flags" which explains the idea
>

Thanks.  Your description is (of course) as clear as day.

Cheers,

Skipper
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to