Created
August 25, 2020 12:44
-
-
Save nelvadas/20bcc22cdc447d352d3996293f2a1196 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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