I want to run a .py file from SpringBoot and then print the output of the file. I am using the following code and I am getting process[pid=aRandomNumber, exitValue="not exited"]
This is the code that I am using
String fetching = "python " + "c:\\Fetch.py \"" + word + "\"";
String[] commandToExecute = new String[]{"cmd.exe", "/c", fetching};
Runtime.getRuntime().exec(commandToExecute);