How can I use the ctypes "cast" function to cast one integer format to another, to obtain the same effect as in C:
int var1 = 1;
unsigned int var2 = (unsigned int)var1;
?
You may want to have a look at http://docs.python.org/2/library/ctypes.html#type-conversions
An example is ctypes.cast((ctype.c_byte*4)(), ctypes.POINTER(ctypes.c_int))