Jython Essentials

Jython Essentials

By: Noel Rappin (author), Samuele Pedroni (author)Paperback

1 - 2 weeks availability

£21.24 RRP £24.99  You save £3.75 (15%) & FREE Saver Delivery on orders over £25


Jython is an implementation of the Python programming language written in 100% pure Java, so it runs under any compliant Java Virtual Machine. The secret to Jython's popularity lies in the combination of Java's libraries and tools with Python's rapid development capabilities. With Jython, you can write Python programs that integrate seamlessly with any Java code. And like Python, Jython can be used interactively, so you can get immediate results as you are programming. Jython Essentials provides a solid introduction to the Python language, offering a brief but thorough tour of the Python concepts you'll need to understand to use Jython effectively. The book makes frequent comparisons between Python and Java, with special emphasis on the different object-oriented semantics of the two languages, so Java programmers can quickly get up to speed with Jython. Jython Essentials also covers the various ways in which Jython and Java can interact. For example, Jython code can create instances of pre-existing Java classes and call methods in those instances. You can write Jython classes that are direct subclasses of existing Java classes and use introspection to discern the capabilities of JavaBeans components. This book provides examples of using Jython with existing Java libraries, including the Swing GUI toolkit, the JDBC database API, the Servlet API, and various XML tools. And finally, the book shows how Jython can be used as a scripting language within a Java program. With Jython Essentials, you have everything you need to start creating applications that mix the best of Python's interactivity and Java's robust libraries.

Create a review

About Author

Samuele Pedroni is one of the main Jython developers. He holds a CS flavored diploma in mathematics from the ETH Zurich (Swiss institute of technology in Zurich). He is now a teacher and research assistant at the Institute of Theoretical CS. He plans to come to the US for a PhD in the field of dynamic languages and dynamic compilation. He came to Jython with the interest in improving it with respect to Java importing and reloading. He has developed several important patches related to java integration, classloaders, and the reworking of java/python importing rules and design. Noel Rappin has a Ph.D. in computer science. His research includes teaching Object-Oriented Programming and Design. He has worked with Java for five years, and with Python more recently. Noel also contributed a chapter, which introduced Squeak to Java or C++ programmers, to the book Squeak: Open Personal Computing and Multimedia (PH).


Foreword Preface 1. Introduction to Jython Jython Requirements Welcome to Jython What's Jython Good For? The Benefits of Jython The Speed Question The Rest of the Book 2. Jython Basics Running Jython Basic Types Operators Numeric Types Sequences: Lists and Tuples Strings Mappings and Dictionaries Jython Files 3. Jython Control Flow Statements and Expressions Assignment Printing Blocks Conditional Logic Loops List Comprehensions Exceptions Evaluating Code Dynamically 4. Modules and Functions Modules Functions Parameter Passing with Style Import Statements and Packages 5. Object-Oriented Jython Creating Classes Methods Classes, Instances, and Access Control Inheritance Special Methods 6. Using Java from Jython Basic Object Usage Automatic Type Conversion Java Arrays and the jarray Module Java-to-Python Types: Automatic Conversion Collection Wrappers Avoiding Name Collisions 7. Inheriting from Java Basic Mechanics Java Interoperation and Overriding Calling Super Methods and Constructors 8. Reflection and JavaBeans Bean-Based Reflection Python-Based Reflection 9. Using Swing Java Versus Jython A Calculator An HTML Browser An HTML Source Browser 10. Using Java Libraries JDBC and the Python Database API Servlets and PyServlet Jython and XML 11. Jython Standard Library Using Python Modules System and File Modules Regular Expressions Serialization and Pickling Unit Testing with PyUnit 12. Embedding Jython Inside Java Setting Up an Interpreter Executing Code Accessing the Interpreter Namespace Using Objects PyObject Subclasses Catching Exceptions Embedding Examples 13. Compiling Jython Why Compile? The Compiler in Action Packaging in Java Archives Using Jython in Java A Simple Applet A. Installing Jython B. Jython Options and Registry C. Jython Exceptions D. Jython and CPython Differences E. Java-to-Python Quick Reference Index

Product Details

  • publication date: 03/04/2002
  • ISBN13: 9780596002473
  • Format: Paperback
  • Number Of Pages: 302
  • ID: 9780596002473
  • weight: 407
  • ISBN10: 0596002475

Delivery Information

  • Saver Delivery: Yes
  • 1st Class Delivery: Yes
  • Courier Delivery: Yes
  • Store Delivery: Yes

Prices are for internet purchases only. Prices and availability in WHSmith Stores may vary significantly