Sam said:
I think you can use Jython that way. Just compile your module to a
.class file using jythonc, then use it like any other class. If you want
to access python modules put "import org.python.modules.MODULENAME.*" in
your Java program.
For this to work though, the Python class must implement or extend a
Java interface/class. Otherwise a pure python class compiled to .class
has a very strange interface indeed.
Also, if the needed python module is a native one, or relies on native
code. you're out of luck.
Depending on the type of integration needed, and the type of module to
integrate. I see that you have 2 choices. Either build a simple JNI
module to embed the Python interprter in Java. Expose a few methods like
execfile and you have simple integration that allows you to call any
python module.
Tighter integration would be very difficult indeed. I am currently doing
the same thing, except in reverse (hosting the JVM inside python) and
its a pretty complicated task. I guess you could use my project to host
your whole program in Python, then make callbacks back into ptyhon code
to use the module. Then again, you could do the same using jython ...
Good luck,
Steve