Table of Contents:
  • Sequences: Lists and TuplesSequence Access; Sequence Functions and Functions; Functional Programming; Tuples: Immutable Sequences; Strings; String Formatting; String Functions; Mappings and Dictionaries; Jython Files; Jython Control Flow; Statements and Expressions; Assignment; Unpacking Assignment; Augmented Assignment; Printing; Blocks; Conditional Logic; Loops; List Comprehensions; Exceptions; Evaluating Code Dynamically; Modules and Functions; Modules; Functions; Parameter Passing with Style; Scoping Rules; Flying First Class; Import Statements and Packages; Import Statements
  • Avoiding Name CollisionsInheriting from Java; Basic Mechanics; Java Interoperation and Overriding; Calling Super Methods and Constructors; Reflection and JavaBeans; Bean-Based Reflection; Using Beans in Jython; Indexed Properties; Event Properties; Python-Based Reflection; Reflecting on Java Objects; Active Reflection; Using Swing; Java Versus Jython; A Calculator; An HTML Browser; An HTML Source Browser; Using Java Libraries; JDBC and the Python Database API; Using zxJDBC; Connection Objects; Cursor Objects; Servlets and PyServlet; Using PyServlet; A Python Template Tool
  • Table of Contents; Foreword; Preface; Audience Expectations; Organization; Further Reading; Conventions Used in This Book; How to Contact Us; Samuele Pedroni's Acknowledgments; Noel Rappin's Acknowledgments; Introduction to Jython; Jython Requirements; Welcome to Jython; Starting Jython; Adding Items to the Window; Adding Behavior; What's Jython Good For?; The Benefits of Jython; For Java Programmers; For Python Programmers; The Speed Question; The Rest of the Book; Jython Basics; Running Jython; Basic Types; Operators; Numeric Types; Integer; Long; Float; Complex; Numerical Functions
  • Includes bibliographical references (pages xvi-xvii) and index
  • Reloading Servlet ModulesJython and XML; SAX and DOM; JDOM and Jython; Jython Standard Library; Using Python Modules; System and File Modules; The sys Module; The os Module; The os.path module; File Pattern Matching with glob; Regular Expressions; The re Module; Match Objects; Regular Expression Objects; Special Characters; Serialization and Pickling; Unit Testing with PyUnit; Simple Tests; Tests in Groups; Embedding Jython Inside Java; Setting Up an Interpreter; Executing Code; Accessing the Interpreter Namespace; Using PyObjects; PyObject Subclasses; Catching Exceptions; Embedding Examples
  • Importing Java ClassesAuto-loading through lookup; Reload; Object-Oriented Jython; Creating Classes; Methods; Classes, Instances, and Access Control; Class and Static Attributes; Access Control; Get and Set Methods; Using __getattr__; Using __setattr__; Inheritance; Special Methods; General Instance Special Methods; Sequences and Mappings; Numbers; Using Java from Jython; Basic Object Usage; Automatic Type Conversion; Managing Overloaded Methods; Basic Data Conversions; Converting Arrays; Java Arrays and the jarray Module; Java-to-Python Types: Automatic Conversion; Collection Wrappers