Skip to content

Instantly share code, notes, and snippets.

@nelvadas
Created August 25, 2020 12:44
Show Gist options
  • Save nelvadas/20bcc22cdc447d352d3996293f2a1196 to your computer and use it in GitHub Desktop.
Save nelvadas/20bcc22cdc447d352d3996293f2a1196 to your computer and use it in GitHub Desktop.
private Function<String, String> loadPythonScript() throws IOException {
Source source = Source.newBuilder("python", new File(pythonScriptFile)).build();
Value pyPart = polyglot.eval(source);
Function<String, String> getDepartmentNameByIdFunc = pyPart.getContext().getPolyglotBindings()
.getMember("getDepartmentNameById").as(Function.class);
return getDepartmentNameByIdFunc;
}
// String dname = getDepartmentNameByIdFunc.apply(departmentId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment