Created
September 3, 2010 12:15
-
-
Save soeren/563805 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
ScriptEngine engine = new ScriptEngineManager().getEngineByName("python"); | |
engine.eval(new FileReader("foobar.py")); | |
Bindings bind = engine.getBindings(ScriptContext.ENGINE_SCOPE); | |
PyFunction func = (PyFunction) bind.get("func"); | |
Foo foo = new Foo(); | |
PyObject ret = func.__call__(Py.java2py(foo)); | |
Bar bar = Py.tojava(ret, Bar.class); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment