'pretty print' for built in types

eric eric at ericaro.net
Tue Dec 9 10:44:03 EST 2008


On Dec 9, 4:31 pm, Robert Dailey <rcdai... at gmail.com> wrote:
> Hi,
>
> Is there a built in way to 'pretty print' a dict, list, and tuple
> (Amongst other types)? Dicts probably print the ugliest of them all,
> and it would be nice to see a way to print them in a readable way. I
> can come up with my own function to do this, but I don't want to do
> this if I don't have to.


you can have a look at [http://code.google.com/p/prynt/ prynt], it
provides some simple functions, to pretty print into RestructuredText,
and then, when the process is finished (it's an option) show the
'console' converted into html.
dict are transformed into definition:
 key: value
 key: value


it helps ?



More information about the Python-list mailing list