I am trying to execute a .py file from java code. I move the .py file in the default dir of my java project and I call it using the following code:
Strin
I believe we can use ProcessBuilder
Runtime.getRuntime().exec("python "+cmd + py + ".py");
.....
//since exec has its own process we can use that
ProcessBuilder builder = new ProcessBuilder("python", py + ".py");
builder.directory(new File(cmd));
builder.redirectError();
....
Process newProcess = builder.start();