Logger module in python
Paul Smith
paul at mad-scientist.net
Tue Dec 17 22:46:06 EST 2013
On Wed, 2013-12-18 at 03:27 +0000, Mark Lawrence wrote:
> On 18/12/2013 03:22, smilesonisamal at 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.
>
> http://docs.python.org/3/library/logging.html
That's not what the OP wants.
Pradeep, if you want to dump data for debugging take a look at the
pprint module; for example:
http://docs.python.org/3.3/library/pprint.html
If you want to store Python objects in files and read them later, most
people seem to use pickle for that:
http://docs.python.org/3.3/library/pickle.html
Others translate into another format.
See this SO question for some other suggestions:
http://stackoverflow.com/questions/2540567/is-there-a-python-equivalent-to-perls-datadumper
More information about the Python-list
mailing list