Java和Python可以在同一个应用程序中共存吗?
我需要一个Java实例直接从Python的实例数据存储中获取数据。我不知道这是否可能。数据存储是透明/唯一的,还是每个实例(如果它们确实可以共存)都有其单独的数据存储?
总结:Java应用程序如何从Python应用程序的数据存储中获取数据,反之亦然?
I need to have a Java instance fetching data directly from the Python's instance datastore. I don't know if that's possible at all. Is the datastore transparent/unique, or each instance (if they can indeed coexist) has its separate datastore? Suming it up: how can a Java app fetch data from the datastore of a Python app, and vice-versa?
您可以使用 jython 。这是一个用java编写的python实现。你可以用这种方式从python调用java函数/类。这将允许您在java实例中运行python代码。
You could use jython. It's a python implementation written in java. You can call java functions/classes from python that way. That would allow you to run python code in the java instance.
我不知道有什么可以做相反的事情(在python进程中运行java)。
I don't know of anything to do the opposite (run java inside a python process).