applezxy
千岩万壑不辞劳,远看方知出处高,溪涧岂能留得住,终归大海作波涛。

调用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());

posted on 2020-05-13 17:28  applezxy  阅读(358)  评论(0编辑  收藏  举报