Class PythonScriptExecutor


  • @Service
    public class PythonScriptExecutor
    extends Object
    Executes a Python script with the Python version installed on server executable in a new process.
    • Constructor Detail

      • PythonScriptExecutor

        public PythonScriptExecutor​(@Value("${python_script_executable:/usr/bin/python}")
                                    String pythonScriptExecutable)
    • Method Detail

      • executeScript

        public void executeScript​(String pythonScript,
                                  PythonOutputHandler outputHandler)
        Execute a python script and wait for it to finish
      • getCommand

        protected static String[] getCommand​(String pythonScriptExecutable,
                                             String tempScriptFilePath)