调用py文件来生成MD5码,脚本如下:
import java.io.BufferedReader;
Process proc;
StringBuilder response = new StringBuilder();
try {
proc = Runtime.getRuntime().exec("python E:\\***.py");
BufferedReader in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line = "";
while ((line = in.readLine()) != null) {
response.append(line);
}
System.out.println(response);
in.close();
System.out.println(response.toString());
proc.waitFor();
}catch (IOException e) {
e.printStackTrace();
}catch (InterruptedException e) {
e.printStackTrace();
}
vars.put("tokenType2",response.toString());