Write a binary pickled representation of an object to a file.
Note that Field and FieldList objects are picklable and their pickle file size will be very small if their data arrays contain file pointers as opposed to numpy arrays.
The pickling is equivalent to:
import cPickle
fh = open('file.pkl', 'wb')
cPickle.dump(x, fh, 2)
fh.close()
Parameters : |
|
---|---|
Returns : | None |
Raises : |
|
Examples
For any picklable object, x:
>>> cf.pickle(x, 'file.pkl')
>>> y = cf.unpickle('file.pkl')
>>> cf.equals(x, y)
True