Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.
Is there a standard way, in Python,
You can mask everything by 0xFFFFFFFF:
0xFFFFFFFF
>>> m = 0xFFFFFF00 >>> allf = 0xFFFFFFFF >>> ~m & allf 255L