Interapp communication under Python[Linux]?

brueckd at tbye.com brueckd at tbye.com
Fri Sep 6 20:53:05 CEST 2002


On Fri, 6 Sep 2002, Robert Oschler wrote:

> My Python app will talk to 3 or 4 modules written in Java and C/C++.
> Fortunately I have the source for the Java and C/C++ modules and I have
> experience in both languages.  Currently the external modules have no
> provision for being accessed outside of the process they are running as.  So
> I'm wondering what the best protocol would be used to "glue it all
> together".  There a dizzying array of possibilities:
> 
> 1) Have everybody talk to each other via SOAP (web services).
> 2) Have everybody talk to each other via XML-RPC (Don't know much about this
> method).
> 3) Use Boost's SWIG interface for C++ to link the C/C++ modules to Python.
> How to link to Java in the same manner?
> 4) Use "sockets" and my own custom protocol for everybody.
> 5) Code in Jython instead and use various methods above to talk to C/C++
> modules from Jython app.
> 6) CORBA? (yikes!)
> 
> So as I said, a lot of ways to get things done.  I'd like to hear from those
> of you that have actually done a lot of cross-app communication with Python
> on what your experiences have been, and the pros and cons you encountered.

It depends on the nature of the communication between the various parts. 
Is the communication lots of frequent messages? Are the messages large or 
small? Does communication mostly flow in one direction?

It _sounds_ like you want the separate pieces to act as if they were all 
one giant process, so maybe really linking them together is the way to go. 
Personally I really like a socket-based approach (roll your own protocol 
or use XML-RPC/SOAP/etc).

Putting such questions aside, I'd first evaluate your solutions in terms 
of difficulty in Java and C++ because all of the ones you listed are 
pretty easy in Python.

-Dave





More information about the Python-list mailing list