final Runtime runtime = Runtime . getRuntime (); Process process = null ; String [] cmds = { "D:\\APP\\python\\python.exe" , "E:\\theatre\\src\\test\\java\\com\\devin\\web\\controller\\test.py" }; try { process = new ProcessBuilder ( cmds )
Process process = null;
String[] cmds = {"D:\\APP\\python\\python.exe","E:\\theatre\\src\\test\\java\\com\\devin\\web\\controller\\test.py"};
try {
process = new ProcessBuilder(cmds).start();
BufferedReader stdout = new BufferedReader(new InputStreamReader(process.getInputStream()));
String l;
l = stdout.readLine();//读取一行
System.out.println(l);
}
catch(Exception e) {
System.out.println(e.getMessage());
}