Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Peng Yu
On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with R, If you have no idea of R, what I want is to print the class

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 12:14 PM, Peng Yu pengyu...@gmail.com wrote: On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Peng Yu
On Sun, Sep 27, 2009 at 1:20 PM, Simon Forman sajmik...@gmail.com wrote: On Sun, Sep 27, 2009 at 12:14 PM, Peng Yu pengyu...@gmail.com wrote: On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Zero Piraeus
: 2009/9/27 Peng Yu pengyu...@gmail.com: But I want an even simpler solution. I don't want the user to define __pretty__. Is there a tool that can automatically print the content of an object without defining such a member function like __pretty__. Not tested (much): from pprint import

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread John Nagle
Zero Piraeus wrote: : 2009/9/27 Peng Yu pengyu...@gmail.com: But I want an even simpler solution. I don't want the user to define __pretty__. Is there a tool that can automatically print the content of an object without defining such a member function like __pretty__. Not tested (much):

Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-26 Thread Peng Yu
Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with R, If you have no idea of R, what I want is to print the class information of an object and the values of its members. Overloading '__expr__' and '__repr__' then using 'print' can sort of

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-26 Thread Robert Kern
On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with R, If you have no idea of R, what I want is to print the class information of an object and the values of its members. Overloading '__expr__' and