Skip navigation links

Package org.jpy

Provides the classes necessary to create an embedded Python VM, to execute Python code, to import Python modules, to access Python variables, and finally to call Python functions and class methods.

See: Description

Package org.jpy Description

Provides the classes necessary to
  1. create an embedded Python VM,
  2. to execute Python code,
  3. to import Python modules,
  4. to access Python variables, and finally
  5. to call Python functions and class methods.

The entry point to the jpy Java API is the PyLib class which is used to either detect an already running Python interpreter or to start a new one:

     if (!PyLib.isPythonRunning()) {
         PyLib.startPython(opt1, opt2, ...);
     }
 
jpy API clients should first call PyLib.isPythonRunning() in order to check if a Python interpreter is already available. If not, PyLib.startPython(String...) must be called before any other jpy API is used.

Once the Python interpreter in running clients can either execute Python code directly using the PyLib.execScript(String) method or load a Python module using PyModule.importModule(String). The returned PyModule object then is the entry point to access Python variables and invoke functions.

Some PyModule methods return PyObject instances. These can be used to create instances of Python classes, and to access Python class members, attributes and to invoke Python object methods..

Since:
0.7
Skip navigation links

Copyright © 2014–2017 Brockmann Consult GmbH. All rights reserved.