iosamammohamed iosamammohamed - 3 years ago 171
Java Question

Run two pieces of code from different programming language in parallel

Is there any way to run a function from python and a function from java in one app in parallel and get the result of each function to do another process?

Answer Source

There are at least three ways to achieve that.

a) You could use java.lang.Runtime (as in Runtime.getRuntime().exec(...)) to launch an external process (from Java side), the external process being your Python script.

b) You could do the same as a), just using Python as launcher.

c) You could use some Python-Java binding, and from Java side use a separate Thread to run your Python code.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download