manipulating bits in python

Jim Richardson warlock at eskimo.com
Sat Sep 30 16:51:38 EDT 2000


I have a ??? re: manipulating bits in python. I have a need to do quick and
simple bit twiddling, shiftright, invert etc. THe operator module has s shiftR
but how can I catch the bit that falls off without a lot of grotty_code? 
 Also, I can't seem to figure a "invert" number, something that would take
for example, 0x01 and return 0xFE, I can do this fairly simply, but am confused
at not finding a simple call for it. Am I missing something? thanks all

-- 
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.




More information about the Python-list mailing list