From: Jake B <ota...@gm...> - 2007-08-22 23:52:33
|
Thank you for the quick replies! Jythonconsole is very interesting. Also, I found that the commercial version of Pydev supports some autocompletion and autoimports libraries. Unfortunately, Pydev autocompletion doesn't work perfectly, and jythonconsole does not yet adequately fulfill my needs for an editing environment. For now, I'd just be happy to have the inspect module working. The developer of jythonconsole says that he uses inspect.py in his implementation, but whenever i'm using jython and I try to import it, I always get an error message saying that the module cannot be found. When I'm in python, however, I'm able to import it just fine. If anyone has any advice as to how I could troubleshoot this, I would greatly appreciate it if you would let me know. Thanks. Jake On 8/21/07, Pekka Laukkanen <pe...@ik...> wrote: > > 2007/8/21, Jake B <ota...@gm...>: > > I was wondering if there > > were any other function that could retrieve an object's public methods > and > > other constructs. > > You probably already know about it but simply using dir(object) gives > you list of all the object's attributes. If you are only interested > about methods, relatively simple code like below can help. > > >>> from java.lang import String > >>> from types import MethodType > >>> s = String('') > >>> for a in [a for a in dir(s) if type(getattr(s, a)) is MethodType ]: > ... print a > > > Cheers, > .peke > |