I definitely wasn’t throwing down the guantlet to Carl. I guess I was just sub-consciously imitating him. But you know what they say about imitation - it’s the sincerest form of complement. I just wish I could tap into his head a little more!
Regarding introspection, I know enough to be dangerous. In this case, I didn’t really use introspection. I just thought that if there was a .columnCount property, there was likely a .rowCount property. I tried it and it worked.
I just happen to have some background in Python, having used it to teach my daughter a computer science class for our home school. I have also used it to develop a simple application that needed to run on both Windows and Linux boxes. I truly like the power and elegance of Python. Not to mention, it’s free. The only major issue that I have is the difficulty of developing a graphical application. All the gui toolkits seem to have a large learning curve and don’t have a good development environment.
I know about the introspection dir() command and how powerful it is in ‘standard’ Python. I tried it but it returned an empty list. Apparently dir() is not supported in Jython, always returning an empty list. I read up on it on the Jython web site FAQ (http://www.jython.org/Project/userfaq.html) where this is addressed, even though I’m not sure I fully understand the answer. I think it boils down to the fact that Jython is a thin veil over Java and there is no way of doing the same introspection of Java as there is of ‘standard’ Python.
Carl, it would be nice if you would give a brief explanation of what you were thinking about when you referred to introspection.
I also want to delve into the subject of leveraging Java from Jython. Could you give some examples, or refer me to some, that would get me started on the basics. I have found some documentation on the web that helped explain classes such as java.awt.color but am having trouble understanding how exactly to use Java classes from Jython. I’ve even ordered the book “Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython” in order to try to learn more.
I’ve also been experimenting to determine which Jython modules are available for import. So far I’ve been successful in importing (but not necessarily using) the following modules (from list at http://docs.python.org/lib/modindex.html):
I know the following modules won’t import:
Is there a list of supported Jython modules?
Obviously, I’m a little curious. Sorry!