Is there a module for print object in a readable format?

dcrespo dcrespo at gmail.com
Wed Oct 19 10:54:00 EDT 2005


Maybe you don't have an up to date python version. I'm using 2.4.2.
I tried:

import pprint
pprint.pprint([1,2,3,4,[0,1,2,[3,4]],5], width=1,indent=4)
[   1,
    2,
    3,
    4,
    [   0,
        1,
        2,
        [   3,
            4]],
    5]

Works fine.




More information about the Python-list mailing list