Skip to content

Instantly share code, notes, and snippets.

@eaaltonen
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eaaltonen/d687090bd675f1014f59 to your computer and use it in GitHub Desktop.
Save eaaltonen/d687090bd675f1014f59 to your computer and use it in GitHub Desktop.
Setting python.path to embedded Jython interpreter
Properties props = new Properties();
props.setProperty("python.path", Paths.get(".").toAbsolutePath().normalize().toString());
interpreter = new PythonInterpreter(); // silly me, this goes after the initialize
PythonInterpreter.initialize(System.getProperties(), props,
new String[] {""});
interpreter.exec("import sys; print sys.path");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment