Talking to Java from Python?

Derek Thomson derek at wedgetail.com
Sun May 5 00:54:21 EDT 2002


Hi,

Etienne Labuschagne wrote:
> Hi there,
> 
> This may sound stupid, but is it possible to create a "bridge" .dll 
> between Python and Java code?  I am thinking of something that can be 
> imported by Python and also by Java (using maybe JNI?) and so be able to 
> get the two to talk to each other.  I know about Jython, but that is 
> sometimes not the solution.

Why? It's worked great for me. I'd like to know what limitations you've 
encountered, apart from execution speed.

> 
> I know one can use sockets or something like XML-RPC or Soap to get the 
> two to communicate, but I am hoping for something more along the lines 
> above.

Something more scalable, mature and OO than either of those is CORBA. 
There are CORBA implementations with Python support, and with Java support.

For Python support, go to: http://sourceforge.net/projects/fnorb, or 
http://omniorb.com

For Java: http://jacorb.org is one option, but I believe there is built 
in CORBA support for Java these days.

CORBA has the additional advantage that it is location transparent i.e. 
you can trivially move your objects to separate hosts without changing 
your code.

Apart from that, I don't think there's much else. The processes are 
going to have to communicate *somehow*.

Regards,
Derek.





More information about the Python-list mailing list