examining python objects
Colin J. Williams
cjw at sympatico.ca
Sun Nov 20 19:01:53 EST 2005
rurpy at yahoo.com wrote:
> Bruno Desthuilliers wrote:
>
>>rurpy at yahoo.com a écrit :
>>
>>>Is there a function/class/module/whatever I can use to
>>>look at objects? I want something that will print the object's
>>>value (if any) in pretty-printed form, and list all it's attributes
>>>and their values. And do all that recursively.
>>>I want to be able to find out everything about an object that
>>>Python can introspectively find out.
>>
>>Then check the inspect module
>
>
> I want a callable, ready-to-use class or function.
> Inspect provides soime funtions that would be useful for wrinting
> such a class or function, but does not provide one.
>
> I seems that nobody who has written or used such a tool reads
> this group, or feels like responding.
>
> FWIW, (for anyone looking for something similar in the future)
> I found http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/137951
> which will format and print an object's attributes. By combining that
> and pprint in the Python distrib, I think can coble up what I am
> looking
> for.
>
> Still, it is discouraging that such a basic thing is not provided with
> python, or at lleast easily available in some library.
>
In the interactive mode, you might try >> help(object)
Colin W.
More information about the Python-list
mailing list