using inspect on pygtk

C

Chris Pax

Hello,

I recently been trying to use the inspect module to inspect the
arguments of gtk objects, such as gtk.Button. I tried like this:

inspect.getargspec(gtk.Button.__init__)

and get the fallowing error:

File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function


I have been trying to do this through code so that I don't have to
have a list of all possible gtk classes and their arguments.
 
C

Chris Pax

Hello,

I recently been trying to use the inspect module to inspect the
arguments of gtk objects, such as gtk.Button. I tried like this:

inspect.getargspec(gtk.Button.__init__)

and get the fallowing error:

File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function

I have been trying to do this through code so that I don't have to
have a list of all possible gtk classes and their arguments.

does anybody have any idea?
 
C

Cousin Stanley

does anybody have any idea?

Chris ....

You might try the following newsgroup on the Gmane server
for Python / Gtk questions ....

gmane.comp.gnome.gtk+.python
 
?

=?ISO-8859-1?Q?BJ=F6rn_Lindqvist?=

Hello,

I recently been trying to use the inspect module to inspect the
arguments of gtk objects, such as gtk.Button. I tried like this:

inspect.getargspec(gtk.Button.__init__)

and get the fallowing error:

File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/inspect.py", line 743, in getargspec
raise TypeError('arg is not a Python function')
TypeError: arg is not a Python function

What you are seeing is completely normal. inspect.getargspec(sys.exit)
gives the same result. PyGTK is a wrapper around the GTK+ C library
and since all the code is written in C, inspect can't infer anything
about the function gtk.Button.__init__.
 
C

Chris Pax

What you are seeing is completely normal. inspect.getargspec(sys.exit)
gives the same result. PyGTK is a wrapper around the GTK+ C library
and since all the code is written in C, inspect can't infer anything
about the function gtk.Button.__init__.

ok thank you very much for answering my question.
so, i guess that there is no way to do this via code.. oh well
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top