Note that there are some explanatory texts on larger screens.

plurals
  1. POImporting Python modules in Jython WITHOUT MODIFICATION
    text
    copied!<p>Before someone starts ranting:</p> <h2>I have already gone through several similar questions on numerous forums, but they do NOT answer my question effectively.</h2> <p>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.</p> <p>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.</p> <p>B. How do I use Jython classes in Java? A simple web search shows that there used to be a legendary entity called <code>jythonc</code> 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 <code>ScriptEngine</code> class, which raises the following question: Is it still possible to use classes that I have defined in Jython from Java?</p> <ul> <li>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?</li> <li>If it isn't, then is there some project(working or in-development) that enables this kind of functionality?</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload