• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

从Scala(或Java)使用python代码的最佳方法是什么意思?

用户头像
it1352
帮助1

问题说明

可能重复:
Java Python集成

Possible Duplicate:
Java Python Integration

有一些用Python编写的代码,我需要在Scala中使用它.该代码使用一些本机C.是否可以在Scala或Java中使用它而无需大量重写?

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?

我打算在不理解的情况下将代码用作黑匣子,因此我不希望对其进行研究,而宁愿以某种方式生成可以导入我的代码中的jar.

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

为什么不尝试 Jython ?您直接将python代码编译为Java类,或通过接口从Java调用Python代码.

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

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfkhbc
系列文章
更多 icon
同类精品
更多 icon
继续加载