471,337 Members | 1,117 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

using inspect on pygtk

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.

Sep 29 '07 #1
4 1303
On Sep 28, 9:57 pm, Chris Pax <christopher....@gmail.comwrote:
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?

Oct 1 '07 #2
>I recently been trying to use the inspect module
to inspect the arguments of gtk objects, such as gtk.Button.
....

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
--
Stanley C. Kitching
Human Being
Phoenix, Arizona
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Oct 1 '07 #3
On 9/29/07, Chris Pax <ch*************@gmail.comwrote:
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__.

--
mvh Björn
Oct 1 '07 #4
On Oct 1, 12:53 pm, "BJörn Lindqvist" <bjou...@gmail.comwrote:
On 9/29/07, Chris Pax <christopher....@gmail.comwrote:
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__.

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

Oct 1 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by j_mckitrick | last post: by
4 posts views Thread by j_mckitrick | last post: by
6 posts views Thread by Mark Mitchell | last post: by
1 post views Thread by Thomas Bartkus | last post: by
14 posts views Thread by Rod W | last post: by
reply views Thread by Richard Taylor | last post: by
1 post views Thread by krishnakant Mane | last post: by
reply views Thread by He Jibo | last post: by
reply views Thread by rajasankar | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.