Article - CS160322
How to use Jython to test Windchill APIs
Modified: 13-Dec-2019
Applies To
- Windchill PDMLink 9.0 to 11.1
Description
- How to use Jython to test Windchill APIs
- What is Jython: Jython is a Java implementation of the Python programming language and, while Jython uses Python’s syntax, it will be readily familiar to a Java programmer. Jython brings two important advantages:
- Jython is dynamic: methods can be typed in the interpreter, are immediately invoked by the interpreter, and the result of the invocation is immediately available. This, sometimes referred to as a REPL, offers a level of interaction with code unparalleled by a static class file, even when debugged in a debugger. Furthermore, Jython’s dynamic nature precludes typing variables, casting, writing try/catch blocks (unless this is desired), and so on, resulting in significantly shorter code than Java’s equivalent.
-
Jython interacts seamlessly with Java: Jython brings Python to Java without sacrificing Java. Jython is “pure Java” and can instantiate any Java class and call any Java method or access any Java field (within the restrictions of the Java security model). Beyond simply being able to interact with Java, Jython is notable in that the “impedance mismatch” between it (as a Python implementation) and Java is very small, making interaction with Java simple, predictable, and easy and making conversion to straight-Java trivial.
This is a printer-friendly version of Article 160322 and may be out of date. For the latest version click CS160322