3

I am about to begin a project where I will likely use PyQt or Pyside.

I will need to interface with a buggy 3rd party piece of server software that provides C++ and Java APIs. The Java APIs are a lot easier to use because you get Exceptions where with the C++ libraries you get segfaults. Also, the Python bindings to the Java APIs are automatic with Jython whereas the Python bindings for the C++ APIs don't exist.

So, how would a CPython PyQt client application be able to communicate with these Java APIs? How would you go about it?

Would you have another separate Java process on the client that serializes / pickles objects and communicates with the PyQt process over a socket?

I don't want to re-invent the wheel... is there some sort of standard interface for these types of things? Some technology I should look into? RPC, Corba, etc?

Thanks, ~Eric

eric.frederich
  • 1,598
  • 4
  • 17
  • 30

2 Answers2

0

If you want to maintain complete isolation and increase your robustness (the 3rd party library going down and not taking your client, and if it's buggy I would recommend that) then perhaps something like CORBA is the way forwards. Don't forget that Java comes with a CORBA implementation as standard, so you just need to generate your C proxy from the IDL.

Swig may be of interest if you want to run stuff in-process. It simplifies the binding of components in different languages. Note in particular that it generates bindings for Python and Java.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
0

If the criteria is not reinventing the wheel, there is the SimpleXMLRPCServer and xmlrpclib modules available in the standard library. They should work in Jython too.

Wai Yip Tung
  • 18,106
  • 10
  • 43
  • 47