I want to call a python script from Java. My python version is 2.5 and Java is 6.
My current code:
try{
Process p= Runtime.getRuntime().exec("path/dirs/file.py");
p.waitFor();
} catch (InterruptedException ex){
System.out.println(ex.getMessage());}
}
The error I receive is:
Java.IO.IOException: Cannot run program filename: CreateProcess error = 193, %1 is not a valid Win32 application
#!…in script files. There's no way it would work on all Windoze systems, you'd have to explicitly invoke Python executable and put script as argument to it.