1
我想從java調用python文件。但它會拋出以下錯誤。從java調用python文件會拋出錯誤
java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
的代碼,我曾嘗試是:
Process p = Runtime.getRuntime().exec("python C:\\Project\\Script\\Test.py");
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
System.out.println(in.readLine());
可能是什麼問題呢?
我想下面的鏈接可以幫助你,再次【JAVA的ProcessBuilder無法查找文件指定](https://stackoverflow.com/questions/28204342/java-processbuilder-cannot-find-file-specified) –