Before someone starts ranting:
I have already gone through several similar questions on numerous forums, but they do NOT answer my question effectively.
Now to the question: Although Java has always been my preferred language, the last few weeks have seen me turning to Jython for most of my needs. My question has actually forked into two since its inception, and I am aching to get a definite answer.
A. Can python modules be imported AS IS in jython? I have read many such questions on different forums, but have never seen a clear response. I want to know whether Python and Jython have some fundamental differences that may not allow this, and whether Python modules can be imported in Jython scripts without ANY modifications, whatsoever.
B. How do I use Jython classes in Java?
A simple web search shows that there used to be a legendary entity called jythonc
that could compile python code to java bytecode, but that has since suffered extinction. The only other way to access jython code from Java is to use JSR 223 for scripting, by using the ScriptEngine
class, which raises the following question: Is it still possible to use classes that I have defined in Jython from Java?
- If it is, then how do I go about it? For example, how do I extend a class (that has been written in Jython) in Java?
- If it isn't, then is there some project(working or in-development) that enables this kind of functionality?