CPython 2.7 + Java
Question: My major program is written in Python 2.7 (on Mac) and need to leverage some
function which is written in a Java 1.8, I think CPython cannot import Java
library directly (different than Jython)?

If there is no solution to call Java from CPython, could I integrate in this
way -- wrap the Java function into a Java command line application, Python 2.7
call this Java application (e.g. using `os.system`) by passing command line
parameter as inputs, and retrieve its console output?

regards, Lin


Answer:   * If you have lot of dependcieis on Java/JVM, you can consider using `Jython`.
  * If you would like to develop a scalable/maintainable application, consider using microservices and keep Java and Python components separate.
  * If your call to Java is simple and it is easy to capture the output and failure, you can go ahead with this running the system command to invoke Java parts.

