Chapter 1. Introduction to Jython
Botanists know that if you cross-pollinate two different strains of plants, you create a hybrid; a new plant that exhibits the strengths of both its parents. Jython is a programming hybrid. It is an implementation of the Python scripting language written in 100% pure Java that runs under any compliant Java Virtual Machine (JVM). Using Jython, you can write Python programs that interact with any Java code. The Jython interpreter supports a number of shortcuts, which make using Java libraries as easy as using your own Python code.
Jython, then, combines a scripting language of unparalleled ease of development with an operating environment for which many powerful tools have been written. The combination can be immensely valuable for programmers, enabling you to cut development time significantly while still retaining the ability to use existing Java tools, such as applets and servlets. Just as Python was originally conceived as glue to bind together other programs, Jython acts as glue to help you get the most out of Java-based tools. In particular, Jython excels at simplifying the use of complex Java programming libraries and APIs, such as the Swing graphical interface toolkit or the JDBC database connectivity API.
This chapter is your road map to the rest of the book. We’ll start with an extended example of using Jython to interactively develop a small graphical interface. Then we’ll discuss why Jython will make it easier for you to get things done. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access