java eclipse插件可以调用外部python脚本吗?
我的意图是开发一个eclipse插件(我将解释为什么我坚持使用eclipse插件),它将在特定位置执行python脚本(例如C:\MyProject\testscript.py)
我很想从那些已经尝试过类似方法的人那里得到关于这种方法是否有效的回应
为什么使用Eclipse插件
我正在尝试侦听来自服务器的通知。尽管服务器公开普通java api,但侦听机制并不是作为普通java api提供的。但是使用服务器提供的eclipse插件,我可以在eclipse UI中看到通知
# 1 楼答案
我建议尝试使用Jython将Java(Eclipse插件)连接到Python。另见Calling Python in Java?(以及可能的Invoking python from Java和/或How to execute Python script from Java?)
# 2 楼答案
是的,这是可能的
示例代码片段
//Python脚本“test.py”是从eclipse插件执行的
公共类SampleHandler扩展了AbstractHandler{
}