Interaction between Java App and Python App

前端 未结 6 1334
余生分开走
余生分开走 2021-01-20 11:33

I have a python application which I cant edit its a black box from my point of view. The python application knows how to process text and return processed text. I have anoth

6条回答
  •  独厮守ぢ
    2021-01-20 11:51

    One possible solution is jpype. This allows you to launch a JVM from Python and pass data back and forth between them.

    Another solution may be to write the Python program as a filter (reading data from stdin and writing result to stdout) then run it as a pipe. However I do not know how well Java supports this - according to the Sun docs their concept of pipes only supports communication between threads on the same JVM.

提交回复
热议问题