Class Python


  • public class Python
    extends Object

    Interface to Python.

    Unless otherwise specified, all methods in this class throw PyException on failure.

    • Method Detail

      • getInstance

        @NotNull
        public static Python getInstance()
        Gets the interface to Python. This method always returns the same object. If start() has not yet been called, it will be called with a new GenericPlatform.
      • getPlatform

        public static Python.Platform getPlatform()
        Returns the Platform object which was used to start Python, or null if start has not been called.
      • isStarted

        public static boolean isStarted()
        Returns whether Python is running.
      • getModule

        @NotNull
        public PyObject getModule​(@NotNull
                                  String name)
        Returns the Python module with the given name. Dot notation may be used to get submodules (e.g. os.path).
      • getBuiltins

        @NotNull
        public PyObject getBuiltins()
        Returns the builtins module. This contains Python's built-in functions (e.g. open), types (e.g. dict), constants (e.g. True) and exceptions (e.g. ValueError).