Jython script + Java script. Explanation request

Hi all,

I have seen how how a java class can be imported and used to create an instance in Ignition script such as this

from java.util import Date now = Date()

I wonder if this can be implemented to all java class

Also, at one point of my development using Ignition, I realized that the script which Ignition uses is actually Jython - which essentially is something like java “wrapper” for Python - instead of (real) Python. Does this make the Ignition script is fundamentally java in Python form? If so, could we use all java logic and classes we know in the Ignition script - as long as we import it?


In the broad scheme of things, I’m going to say yes!

You can use any Java class, and even import “pure” Python libraries.

By “pure” Python, I mean things that don’t rely on libraries written in C. For example, Numpy relies on C libraries-- a lot. So, unfortunately, we can’t use it in Jython. By extension, any library that relies on Numpy are out as well.

Yep, you have access to all the Java classes as well as all (or most, anyway) of the Python 2.5 standard lib.


Thanks for the explanation… :smiley:

All the way I always thought that I was dealing with Python in Ignition. Now, I know that I am actually dealing with Java in Python form here… :wink: