【发布时间】:2016-07-27 07:33:48
【问题描述】:
调用 Python 的 Java 代码:
//arguments to be passed to the script
String[] patchArguments = { patchFileDirectory,centralPatchStagePath,patchId,patchFileName, action };
//initialize the interpreter with properties and arguments
PythonInterpreter.initialize(System.getProperties(), System.getProperties(), patchArguments);
pythonInterpreter = new PythonInterpreter();
//invoke python interpreter to execute the script
pythonInterpreter.execfile(opatchScriptPath + opatchScript);
Traceback(最里面最后):
文件“/scratch/app/product/fmw/obpinstall/patching/scripts/PatchUtility.py”,第 4 行,在?
ImportError: 没有名为子进程的模块
但是子进程已经安装,如果我直接使用终端python PatchUtility.py执行python文件,它就会运行
更新:我发现了一些东西
Jython 有一些限制:
有许多不同之处。一、Jython程序不能使用CPython 用 C 编写的扩展模块。这些模块通常有文件 扩展名 .so、.pyd 或 .dll。
子进程是否在内部调用 C 扩展?
【问题讨论】:
标签: java python jython-2.7