Jython Essentials
By Samuele Pedroni, Noel Rappin
March 2002
Pages: 300
ISBN 10: 0-596-00247-5 |
ISBN 13: 9780596002473
![]()
![]()
![]()
![]()
(4) (Average of 4 Customer Reviews)
Jython is an implementation of the Python programming language written in Java, allowing Python programs to integrate seamlessly with any Java code. The secret to Jython's popularity lies in the combination of Java's libraries and tools with Python's rapid development capabilities. Jython Essentials provides a solid introduction to the language, numerous examples of Jython/Java interaction, and valuable reference material on modules and libraries of use to Jython programmers.
Full Description
Register your book | Submit Errata | Examples
Browse within this book
| Table of Contents | Index | Sample Chapter | Colophon
Book details
First Edition: March 2002
ISBN: 0-596-00247-5
Pages: 300
Average Customer Reviews: ![]()
![]()
![]()
![]()
(4) (Based on 4 Reviews)
Featured customer reviews
A little confusion by Anonymous Reader, July 31 2006
A correct code would be:
import Y
y = Y.Y()
not
Import Y
y = Y()
More examples please, July 30 2004
I thought overall it was well laid out and covered most of the points, but thought it would have been far better if there had been more examples included, and any gotchas.
For example:
Putting the following into Y.py
class Y:
def __init__(self):
print "foo"
then in the console doing:
import Y
y = Y()
gives the following error:
Traceback (innermost last):
File "<console>", line 1, in ?
TypeError: call of non-function (module 'Y')
but it works ok if you type the class definition into the console.
This sort of problem could have been gone into in the book - there are other examples.
The book assumes that one knows exactly how to do things in python, and that everything will work just fine 1st time
Jython Essentials Review, November 24 2003
This book is similar to the other O'Reilly books that have become popular for their conciseness and content--no fluff here. This is the type of book most useful to someone who wants or needs to concentrate on the subject and learn the technology. (It is not a classroom textbook, with exercises, tests, and so forth, though it does have short examples, which are better for learning than long ones, in my opinion.) The book will probably be most accessible to readers who are familiar with core Java. Familiarity with Python would be helpful, but should not be necessary--a three-chapter introduction to Python is included. It should be of interest to Java and Python programmers, and others interested in scripting applications.
Appendices are included on Jython installation, and comparisons between Jython and Python and between Jython and Java. A nice little surprise is a section on the use of PyUnit, the Python counterpart to JUnit, for unit testing, which also includes a discussion on compiling Jython.
The authors explain how to use Java from Jython, including type conversions, and how to subclass Java classes from Jython code. One chapter is devoted to a discussion of Java reflection and working with JavaBeans, and the use of Python reflection. Another includes examples illustrating how to construct an HTML browser and an HTML source browser, using Swing.
Another chapter includes a short discussion on each of JDBC (actually zxJDBC, the Python version), servlets, and parsing XML, with illustrative examples. The parsing examples use SAX, DOM, and JDOM, respectively; the zxJDBC example uses MySQL. The book also includes a brief discussion
of regular expressions, with a couple of short examples.
Finally, there is a chapter explaining how to use Jython from Java, which allows the embedding of a Jython interpreter in a Java program.
Notes: Examples run on Jython 2.0 or higher and jdk1.2 or higher.
The book has a web site with code samples for download, and errata.
Jython Essentials Review, April 23 2002
Overall a very good effort, particularly if you're looking to understand some of the nitty gritty details of Jython. The major missing element however is any coverage of threading/synchronization. Java programming often relies heavily on threading and there is no coverage of how to do it in Jython in this book.
I'd suggest this as a companion guide to New Riders' "Jython For Java Programmers". Each is an excellent book and they complement each other well. Between the breadth of coverage in the NR title and the depth of detail in Jython Essentials you should be outcoding straight Java programmers in no time ;).
Media reviews
"'Jython Essentials' is a concise, detailed walk through of the state of Jython, how to embed Jython, how to use Jython to simplify JavaBeans and Swing programming as well as using PyServlet to make your servlets programming a great deal simpler...In examining this valuable scripting extension to the Java programming model, 'Jython Essentials' fills a much needed gap in the information surrounding this language."
--James Richards, GameJUG, August 2002


