[Tutor] Data::Dumper for Python

Morgan Meader tigershark at morganmeader.com
Thu Oct 28 19:35:44 CEST 2004


Edward,

I asked the same exact question when I recently started learning 
Python(coming from Perl also).

In Perl I use Data::Dumper mostly to review my data visually so I can 
see if I am accessing it correctly in a variety of ways. I also used it 
once for a data persistance operation that I have come to value the 
gnosis.xml.pickle module for in Python.

So for debugging and general understanding and for looking at data 
visually, I have used the pprint module.

import pprint
pp = pprint.PrettyPrinter(indent=4)
pp.pprint(<variableNameHere>)

All,

Thanks for having such informative discussions!

Prost,
Morgan

Edward WIJAYA wrote:

> Hi,
> 
> Is there any equivalent modules of it
> in Python.
> 
> Brian van den Broek suggestion on Python-Perl
> phrasebook:
> <http://www.python.org/moin/PerlPhrasebook>
> is very useful, and cover mostly
> on types and data-structure.
> 
> Any idea if there is any
> similar stuff for Perl-Python Modules
> comparison?
> 




More information about the Tutor mailing list