Python - How to pickle yourself?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-04-25T20:16:24Z Indexed on 2010/04/25 20:33 UTC
Read the original article Hit count: 337

Filed under:
|

I want my class to implement Save and Load functions which simply do a pickle of the class. But apparently you cannot use 'self' in the fashion below. How can you do this?

    self = cPickle.load(f)

    cPickle.dump(self,f,2)

© Stack Overflow or respective owner

Related posts about python

Related posts about pickle