//pythonScript python脚本字符串
String pythonScript;
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(pythonScript.getBytes());
Properties props = new Properties();
props.put("python.home", "C:\\python2");
props.put("python.console.encoding", "UTF-8");
props.put("python.security.respectJavaAccessibility", "false");
props.put("python.import.site", "true");
Properties preprops = System.getProperties();
PythonInterpreter.initialize(preprops, props, new String[0]);
interpreter = new PythonInterpreter();
interpreter.execfile(byteArrayInputStream);