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

2005-10-19 Thread Steven D'Aprano
On Wed, 19 Oct 2005 09:39:48 +0800, James Gan wrote: Hi, Steven :) width parameter do the magic : 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] That's

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

2005-10-19 Thread Micah Elliott
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

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

2005-10-19 Thread Kent Johnson
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

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

2005-10-18 Thread James Gan
Hi, Steven :) width parameter do the magic : 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] Steven D'Aprano wrote: On Mon, 17 Oct 2005 11:31:46 +0200,

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

2005-10-18 Thread James Gan
Yes, that's what I need! Thank you all bruno modulix wrote: James Gan wrote: I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I tried pickled, marshel. They do different work. Is there another module which do

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

2005-10-17 Thread James Gan
I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I tried pickled, marshel. They do different work. Is there another module which do this kind of job? Thanks! James Gan --

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

2005-10-17 Thread bruno modulix
James Gan wrote: I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I tried pickled, marshel. They do different work. Is there another module which do this kind of job? pprint -- bruno desthuilliers

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

2005-10-17 Thread enrico . sirola_NOSPAM
James == James Gan [EMAIL PROTECTED] writes: James I want the object printed in a readable format. For [...] James I tried pickled, marshel. They do different work. Is there James another module which do this kind of job? from pprint import pprint pprint(object) bye, e. --

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

2005-10-17 Thread Steven D'Aprano
On Mon, 17 Oct 2005 17:25:35 +0800, James Gan wrote: I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I think you missed an un- in your first sentence. :-) In general, if you want special/fancy/bizarre

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

2005-10-17 Thread Steven D'Aprano
On Mon, 17 Oct 2005 11:31:46 +0200, enrico.sirola_NOSPAM wrote: James == James Gan [EMAIL PROTECTED] writes: James I want the object printed in a readable format. For [...] James I tried pickled, marshel. They do different work. Is there James another module which do this

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

2005-10-17 Thread Larry Bates
What if a is a tuple of lists? What if b is a class? What if c is a file object? I can't even tell what [d e] means? IMHO the output isn't in a readable format at all (perhaps something got lost in the posting). pprint is as close are you are going to find for a general solution to this