On 17-6-2010 21:51, Back9 wrote:
Hi,

I have one byte data and want to know each bit info,
I mean how I can know each bit is set or not?

TIA

Use bitwise and, for instance, to see if the third bit is set:

byte = 0b11111111
if byte & 0b00000100:
        print "bit is set"

-irmen
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to