You can use ctypes and its c_uint32:
>>> import ctypes
>>> m = 0xFFFFFF00
>>> ctypes.c_uint32(~m).value
255L
So what I did here was casting ~m to a C 32-bit unsigned integer and retrieving its value back in Python format.
You can use ctypes and its c_uint32:
>>> import ctypes
>>> m = 0xFFFFFF00
>>> ctypes.c_uint32(~m).value
255L
So what I did here was casting ~m to a C 32-bit unsigned integer and retrieving its value back in Python format.