Using python code from Java?

Nick Vatamaniuc vatamane at gmail.com
Thu Jul 20 14:13:09 EDT 2006


I can't think of any project that does that. Calling stuff from Java is
not easy to beging with you have to go through the native interface
(JNI) anyway.

I would suggest instead to create some kind of a protocol and let the
applications talk using an external channel (a FIFO pipe file, a socket
or just any network connection.) Usually when you go back and forth
between languages you don't really need a particular class object
(because class objects are quite different between languages) but what
you need is to have data passed back and forth and have both sides
interpret the data and process it. This sort of sounds like a protocol
and it is. Depending on how easy vs. extensible vs. comprehensible your
project is you  could of course use XML RPC but that could get
complicated.

 If you have extra time and desire you can of course contribute and
help bring Jython to 2.3, they can always use some help...

Nick V.


fortepianissimo wrote:
> Is there a solution to enable Java programmers to call functions
> written in Python? Any wrapper generator that wraps Python code into
> some Java-callable form?
>
> I briefly looked at Jython, but if I understand it right, it didn't
> support full power of Python 2.3.x (which I need).
> 
> Any suggestion is welcome!




More information about the Python-list mailing list