I want to run a Python2 Script from my Java application but it doesn't run.
I don't get any Stack or Error - It just does not run!
I tried this:
public void execPython2(String file, String parm0) {
try {
Process p = new ProcessBuilder("python2", file, parm0).start();
} catch (Exception e) {
}
}
Here is the method call:
public String getMAC(String IP_Addr) {
execPython2("getMacAddr.py", IP_Addr);
try {
Thread.sleep(500);
} catch (Exception e) {
}
String macAddr[] = readFromFile("lastMac.log", false);
try {
Thread.sleep(500);
} catch (Exception e) {
}
return macAddr[0];
}
The python2 script will create a "lastMac.log" file.
At first I thought the python script would not be finished and I just have to wait until it is finished but i guess the Python script is not even running.