Communication between JAVA and python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jacques Daussy

    #1

    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


  • Kent Johnson

    #2
    Re: Communication between JAVA and python

    Jacques Daussy wrote:[color=blue]
    > 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 ?[/color]

    Jython has an interpreter and Windows has sockets.

    Kent

    Comment

    • Steve Menard

      #3
      Re: Communication between JAVA and python

      Jacques Daussy wrote:[color=blue]
      > 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
      >
      >[/color]

      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

      Comment

      • Ulrich Schaefer

        #4
        Re: Communication between JAVA and python

        Jacques Daussy wrote:
        [color=blue][color=green]
        >> 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 ?[/color]
        >[/color]
        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

        Comment

        Working...