I have found some tips on how to do that, but combining them together does not work, so i am asking for help.
I have a script in python, which gets it's variables from parameters(arguments?)(sys.argv). I have used PyInstaller to create an exe.
Now i need to open this file, with parameters, from java.
The problem is, i got the error: Failed to execute script [ScriptName].
This is my code from java:
try {
ProcessBuilder process = new ProcessBuilder(Location, arg1, arg2, arg3, arg4,
arg5, arg6, arg7, arg8, arg9,
arg10, arg11, arg12, arg13, arg14);
Process proc = process.start();
proc.waitFor();
} catch (IOException | InterruptedException e) {
//logging the result
e.printStackTrace();
}
And this is my code in python:
arg1 = sys.argv[2]
arg2 = sys.argv[3]
arg3 = sys.argv[4]
arg4 = sys.argv[5]
arg5 = sys.argv[6]
(...)
I have tried different 'argv positions' (i.e. arg1 = sys.argv[1] etc.), but nothing works.
Thanks in advance for any help.