|
|
@@ -25,14 +25,7 @@ public class PythonParse implements ScriptParse {
|
|
|
private PyFunction pyFunction;
|
|
|
private String script=null;
|
|
|
|
|
|
- static {
|
|
|
- //初始化python环境
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
public PythonParse() {
|
|
|
- PySystemState systemState = Py.getSystemState();
|
|
|
Properties props = new Properties();
|
|
|
props.setProperty("python.console.encoding", "UTF-8");
|
|
|
props.put("python.home", "jython-standalone-2.7.1.jar");
|
|
|
@@ -41,8 +34,12 @@ public class PythonParse implements ScriptParse {
|
|
|
props.put("python.import.site", "false");
|
|
|
Properties preprops = System.getProperties();
|
|
|
PythonInterpreter.initialize(preprops, props, new String[0]);
|
|
|
- PythonInterpreter.initialize(System.getProperties(), props, new String[] {});
|
|
|
+ PySystemState systemState = Py.getSystemState();
|
|
|
+// PyString standalone = new PyString("\\python-modules\\Lib");
|
|
|
+// PyString xml = new PyString("E:\\software\\coffee-boot\\coffee-admin\\src\\main\\resources\\python");
|
|
|
+// systemState.path.append(standalone);
|
|
|
log.info("python path >>>>>>>>>>>>>>>>>:{}",systemState.path);
|
|
|
+ PythonInterpreter.initialize(System.getProperties(), props, new String[] {});
|
|
|
interpreter = new PythonInterpreter();
|
|
|
|
|
|
}
|