PyObject Documentation

Dose anyone know where I can find documentation for python objects returned from functions? For example system.gui.getWindow() returns an object of type PyObject according to the documentation but I can’t find any information on the object that is returned.

At the bottom of this page it shows that the window object has some functions to set size and location. What else does it have? How can I find out?

Technically, it is a PyObject wrapping an FPMIWindow. Jython needs PyObjects in the scripting environment, and Java objects (pretty much everything in Ignition) are automatically supported by “wrapping” them with Py.java2py(). Note that FPMIWindow is a subclass of Swing’s JInternalFrame, allowing you to use Swing methods, too.
You can get a headstart on all of this with my introspection script shown in this topic.

You can also use the Graphical Object Inspector Tool to look at the various objects in Ignition and find out what methods they have etc.


Thanks for the replies. Not the easy answer I was hoping for but I should be able to work it out from here.


One nuance that’s not well documented in Jython that might help: the java2py() wrapper method recognizes NetBeans-style getter and setter methods and presents them as properties of the wrapped object. That is, anywhere you’d use:.... wrappedJavaObject.getSomeValue() wrappedJavaObject.setSomeValue(newValue)can by abbreviated:.... wrappedJavaObject.someValue wrappedJavaObject.someValue = newValueNote the camelcase transformation.
One other NetBeans rule: getters for booleans are expected to be named .isSomeValue(), not .getSomeValue(). If you use jython’s dir() function on a wrapped object, you’ll see all of these ‘extra’ properties.