Class Persistence using __dict__
Alex
cut_me_out at hotmail.com
Mon Sep 4 10:32:19 EDT 2000
More information about the Python-list mailing list
Mon Sep 4 10:32:19 EDT 2000
- Previous message (by thread): Python examples.
- Next message (by thread): Class Persistence using __dict__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Usually, when I want to make a class persistent, I just pickle the
class:
class Test:
def Save(self, fn):
cPickle.dump(self, open(fn, 'w')
I only have to do something more elaborate when the class contains a
data structure that pickle doesn't know how to deal with.
HTH.
Alex.
--
The chain of destiny can only be grasped one link at a time.
-- Sir Winston Churchill
- Previous message (by thread): Python examples.
- Next message (by thread): Class Persistence using __dict__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list