471,579 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,579 software developers and data experts.

Communication between JAVA and python

Hello
How can I transfert information between a JAVA application and a python
script application. I can't use jython because, I must use python
interpreter.I think to socket or semaphore, but can I use it on Windows
plateform ?

thanks a lot

jack
Jul 18 '05 #1
3 4922
Jacques Daussy wrote:
Hello
How can I transfert information between a JAVA application and a python
script application. I can't use jython because, I must use python
interpreter.I think to socket or semaphore, but can I use it on Windows
plateform ?


Jython has an interpreter and Windows has sockets.

Kent
Jul 18 '05 #2
Jacques Daussy wrote:
Hello
How can I transfert information between a JAVA application and a python
script application. I can't use jython because, I must use python
interpreter.I think to socket or semaphore, but can I use it on Windows
plateform ?

thanks a lot

jack


Well, it all depends on the exact deployment scenario you;re facing.

If you're java program can be embedded dinside hte python scripts, then
JPype (see my sig at the bottom of this post) can certainly help you.

Otherwise ... Is there a java way to "access" you java program from
outside it's process? I mean things like RMI servers, or EJBs. If so,
again JPype can take the place of a "java" client.

If not, there is no magic. You must first find a way to contact you Java
process. If that remote-call technology is "standard", i.e. Something
like SOAP or XML-RPC, then you can find a python technology to access
it. If its not standard, but tehre is a Java way to use it, Again jpype
can be your friend.

If you can tell us more about the nature of each program (Python and
Java) we may be better able to help you.

--
Steve Menard
--------------------
Maintainer of http://jpype.sourceforge.net
Jul 18 '05 #3
Jacques Daussy wrote:
Hello
How can I transfert information between a JAVA application and a
python script application. I can't use jython because, I must use
python interpreter.I think to socket or semaphore, but can I use it
on Windows plateform ?

Try XML-RPC (a simple implementation of remote procedure call via HTTP
sockets).
It's built-in in Python since 2.2
(http://www.python.org/doc/2.4/lib/mo...mlrpclib.html),
in Java use e.g. Apache XML-RPC (http://ws.apache.org/xmlrpc/).

Ulrich
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Harald Massa | last post: by
reply views Thread by John Pedersen | last post: by
reply views Thread by misama | last post: by
5 posts views Thread by AeonOfTime | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.