Help with pprint

Emile van Sebille emile at fenx.com
Wed Nov 25 12:35:53 EST 2009


On 11/25/2009 4:47 AM Nadav Chernin said...
> Hello, I want to print list of lists in matrix format. So I use pprint 
> with parameter ‘width’ for this target.
<snip>
> The problem that I don’t know how to select width value, because if:
> 
>  
> 
>  >>>data=[['one', 'one', 'one'], ['one', 'one', 'one'], ['one', 'one', 
> 'one']]  
> 
>  >>> pprint(data,width=20)

Almost...

 >>> pprint.pprint(data,width=24)
[['one', 'one', 'one'],
  ['one', 'one', 'one'],
  ['one', 'one', 'one']]

Emile




More information about the Python-list mailing list