What is the best way to use python code from Scala (or Java)? [duplicate]

孤街浪徒 提交于 2019-12-12 08:11:55

问题


Possible Duplicate:
Java Python Integration

There is some code written in Python and I need to use it from Scala. The code uses some native C. Is it possible to use this from Scala or Java without having to rewrite much?

I intend to use the code as a black-box without understanding, so I prefer not to look into it but rather to somehow generate a jar that I can import in my code.


回答1:


Why not try Jython?You directly compile python code to Java classes or call Python code from Java through interface.



来源:https://stackoverflow.com/questions/10882488/what-is-the-best-way-to-use-python-code-from-scala-or-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!