In article <fabe3b07-3d2f-48f2-9e56-2fdebff39...@googlegroups.com>, smilesonisa...@gmail.com wrote:
> Hi, > I am a newbie in python. I am looking for a existing module which I can > import in my program to log the objects to a file? > > I know there is a module Data::Dumper in perl which dumps the objects to > file. But not sure about python. You're talking about what's known as serializing an object. Taking the in-memory representation and turning it into something that can be written into a network connection or into a file, then read back in, and turned back into an in-memory object. The standard way to do this in Python is pickle (http://docs.python.org/2/library/pickle.html). Depending on the type of data you have, you might want to use JSON encoding instead (http://docs.python.org/2/library/json.html), but pickle is probably the most similar to Data::Dumper. -- https://mail.python.org/mailman/listinfo/python-list