[newbie]Is there a module for print object in a readable format?

Kent Johnson kent37 at tds.net
Wed Oct 19 11:43:20 EDT 2005


Micah Elliott wrote:
> On Oct 20, Steven D'Aprano wrote:
> 
>>That's not what I get. What are you using?
>>
>>py> pprint.pprint([1,2,3,4,[0,1,2], 5], width=1, indent=4)
>>Traceback (most recent call last):
>>  File "<stdin>", line 1, in ?
>>TypeError: pprint() got an unexpected keyword argument 'width'
> 
> 
> I find it useful to have all relevant python versions (as listed on
> http://www.python.org/download/) installed on my primary test
> machines.

If you want to know when a feature was introduced, the docs are often helpful:

pprint(  	object[, stream[, indent[, width[, depth]]]])
<snip>
    Changed in version 2.4: The parameters indent, width and depth were added. 

Kent



More information about the Python-list mailing list