INTP = ctypes.POINTER(ctypes.c_int)
num = ctypes.c_int(42)
addr = ctypes.addressof(num)
print('address:', addr, type(addr))
ptr = ctypes.cast(addr, INTP)
ctypes: construct pointer from arbitrary integer