开发者

Can Java and Python coexist in the same app?

开发者 https://www.devze.com 2023-01-25 07:25 出处:网络
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 ca

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?


Different versions of an app share a datastore, and AFAIK you can still have a Java version of your app, and Python version, at the same time. It used to be a necessary hack to use features that were implemented in Python but not (yet) in Java, and quite possibly still is.

Of course only one of those versions can be the default, but other versions are accessible.


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.

I don't know of anything to do the opposite (run java inside a python process).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号