easy way to dump a class instance?

Carl J. Van Arsdall cvanarsdall at mvista.com
Fri May 5 15:06:13 EDT 2006


Mark Harrison wrote:
> Is there a way to automatically print all the instance
> data in a class?  This is for debugging, I would like
> to do something like dump(self) to snapshot the state
> of the object.
>
>
>   
Would something like cPickle work?  That allows you to dump objects into 
files as they are and read them again as they were.  Its fairly easy to 
use and might work well for you.

HTH

-carl


-- 

Carl J. Van Arsdall
cvanarsdall at mvista.com
Build and Release
MontaVista Software




More information about the Python-list mailing list