public static void initAndExecPythonScript ( PythonEnvironmentFactory factory , java . nio . file . Path scriptDirectory , String scriptName , String [ ] args ) { String [ ] fullArgs = new String [ args . length + 1 ] ; fullArgs [ 0 ] = scriptDirectory . resolve ( scriptName ) . toString ( ) ; System . arraycopy ( args , 0 , fullArgs , 1 , args . length ) ; PythonInterpreter pythonInterpreter = initPythonInterpreter ( fullArgs , scriptDirectory . toUri ( ) . getPath ( ) , scriptName ) ; pythonInterpreter . set ( "__flink_env_factory__" , factory ) ; pythonInterpreter . exec ( scriptName + ".main(__flink_env_factory__)" ) ; }
Initializes the Jython interpreter and executes a python script .