Is there a way to save the state of a class??

EdwardT edwardt at trillium.com
Fri Apr 20 19:47:34 EDT 2001


I just came across of a featuer that provides that saves objects into bytes
stream and stored as a file. The funciton is pickle, cPickle, marshal or
shelf. But I am not quite sure if they helps here and didn't find many
exmaple for explanation of their use.
Form the doc it says pickle and cPickle, as opposed to marshal, can be used
for user defines class also., while cPickle is just the faster form.


Can someone shed some light over this?
Thanks
"EdwardT" <edwardt at trillium.com> wrote in message
news:9bpra9$q0l at news.or.intel.com...
> Hello, I current have a script that do certain processing on files, and
> requires user to enter certain info such as:
> 1. inputfile name
> 2. output file name
> 3. whether it would like process all files recusively or just one (stored
as
> a Int instance in class, value got from CheckButton widget in runtime )
> 4. a string that supplies the protocol stack it is building. (stored as a
> string instance in class)
>
> Instead of writing some code to save all these some sort of  text file;
and
> re-read the next time ithe script got invoked.  Does python offer the
option
> to save the state of the whole script, as some kind of persistence
objects?
>
> I am using python1.5.2.
>
> Thanks
>
>





More information about the Python-list mailing list