> Phillip Ezolt <[EMAIL PROTECTED]> wrote:

>         Is there anyway to:
>         1) Instantiate an Object
>         2) Ask it all of the attributes & methods that it has? 

What you want to do is use the class not an instance of the class, like
this:

gtk.GtkText.__dict__

It would be easy to write a util to output that in more readable format.

You could go further for each thing in this dict with something like this:

method = gtk.GtkText.__dict__['get_text']
co = method.func_code
argcount = co.co_argcount
argnames = co.co_varnames[:argcount]

A great resource for python introspection is the Python Quick Ref:

http://starship.python.net/quick-ref1_5.html

See the "Special informative state attributes for some types" sub-section.

Hope that's helpful and sorry if this has been answered already today (I
get the digest).

- Stephan

------------------------------------------------------------------------
Archaeopteryx Software, Inc.                        Wing IDE for Python
www.archaeopteryx.com                               Take Flight!



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to