JEP and JPype in a single process

skn skn at skn.com
Mon Jun 20 15:06:27 CEST 2005


Hello,

I have written a very simple java class file, which invokes a Python script
using JEP.

Code snippet:-
-------------------
Jep jep = new Jep(false);
jep.runScript("C:\\temp\\testscript.py");
jep.close();

Now inside this Python script I want to make Java calls using JPype.
If I use startjvm() inside this Python script, a Runtime Error (exception)
is thrown.
Also tried attachThreadToJVM(), but doesn't work, again Runtime Error.

Any clues as to how I could achieve my goal??
The interaction shown below should happen in a single process.

JAVA ==> jep ==> PYTHON ==> jpype ==> JAVA

Regards,
skn





More information about the Python-list mailing list