How to save ctypes objects containing pointers
To pickle a ctypes object that has pointers, you would have to define your own __getstate__/__reduce__ methods for pickling and __setstate__ for unpickling. More information in the docs for pickle module.
I use a 3rd party library which returns after a lot of computation a ctypes object containing pointers.
How can I save the ctypes object and what the pointers are pointing to for later use?
I tried 

scipy.io.savemat => TypeError: Could not convert object to array
cPickle  => ctypes objects containing pointers cannot be pickled