Is it possible to save a running program and reload next time ?

fdu.xiaojf at gmail.com fdu.xiaojf at gmail.com
Fri Sep 22 02:16:52 EDT 2006


Hans Georg Krauthaeuser wrote:
> fdu.xiaojf at gmail.com wrote:
>   
>> Can objects be saved and reloaded by "Pickle"  ?  I have tried but no
>> success.
>>
>>     
> Yes, that's the intended use of pickle/cPickle. There are examples in
> the docs:
>
> http://docs.python.org/lib/module-pickle.html
>
> What have you tried and what didn't work?
>
> Hans Georg
>   
My program is a genetic algorithm based program, so I thought I just 
need to save a generation object of the population and reload it later 
then my program could continue. But after I saved a generation object 
from within python using cPickle and reload it from another program, it 
said that some class object couldn't be found. Now I realized that a 
program cannot be suspended and reloaded by just simply dumping and 
loading using cPickle/Pickle.

I will try stackless python later.

Thanks a lot .

Regards,

xiaojf




More information about the Python-list mailing list