Jython is an implementation of Python written in the Java language and integrated with the Java platform.
Unlike the Java programming language, Jython is a scripting language. Moreover Jython is an agile language. Agile languages are easy-to-use and yet powerful and expressive. They are also ideal rapid prototyping languages.
Jython is built on the Java platform.
At its heart Jython is an interpreted language. In Jython, there is no pre-compile step as there is in Java and C++; each time Jython code is run it is interpreted afresh. As such, code changes can be very quickly made and tested. Jython code can also be entered interactively (that is, one line at a time). Furthermore, you can dynamically construct Jython code (that is, as a string) and execute it directly. This enables coding flexibility not possible in Java coding.
Advantages of Jython are as follows:
- One of Jython’s biggest advantages is that it runs on any JVM, so applications coded in Jython can run on almost any computing system.
- Like the Java language and unlike some other scripting languages such as Perl and
Rexx, Jython was designed to be an object-oriented language from the start.
- Jython supports a sophisticated packaging scheme, similar to that of the Java language.
- By virtue of its object-oriented nature, Jython is highly extendable and provides the latest constructs for effective software engineering.
- One of the easiest ways to use Jython is as a command-line interpreter. In this manner, lines of code are entered one line at a time and you can see the results immediately. This is an ideal way to learn Jython and to try out new coding techniques with minimal overhead.
- Jython has full and nearly seamless integration into any Java libraries and code.
- Jython can access many of the libraries and frameworks written in Python.
- Employs “duck typing”
Pythonic programming style that determines an object’s type by inspection of its method or attribute signature rather than by explicit relationship to some type object (“If it looks like a duck and quacks like a duck, it must be a duck.”) By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck-typing avoids tests using type() or isinstance().