Programming Python, Second Edition
Object-Oriented Scripting
By
Mark Lutz
March 2001
Pages: 1296
| Table of Contents
| Index
| Sample Chapter
| Colophon
Table of Contents
-
Chapter 1 Introducing Python
-
"And Now for Something Completely Different"
-
The Life of Python
-
The Compulsory Features List
-
What's Python Good For?
-
What's Python Not Good For?
-
System Interfaces
-
Chapter 2 System Tools
- "The os.path to Knowledge"
- Why Python Here?
- System Scripting Overview
- The sys Module
- The os Module
- Script Execution Context
- Current Working Directory
- Command-Line Arguments
- Shell Environment Variables
- Standard Streams
- File Tools
- Directory Tools
-
Chapter 3 Parallel System Tools
- "Telling the Monkeys What to Do"
- Forking Processes
- Threads
- Program Exits
- Interprocess Communication
- Pipes
- Signals
- Launching Programs on Windows
- Other System Tools
-
Chapter 4 Larger System Examples I
- "Splits and Joins and Alien Invasions"
- Splitting and Joining Files
- Generating Forward-Link Web Pages
- A Regression Test Script
- Packing and Unpacking Files
- User-Friendly Program Launchers
-
Chapter 5 Larger System Examples II
- "The Greps of Wrath"
- Fixing DOS Line Ends
- Fixing DOS Filenames
- Searching Directory Trees
- Visitor: Walking Trees Generically
- Copying Directory Trees
- Deleting Directory Trees
- Comparing Directory Trees
-
GUI Programming
-
Chapter 6 Graphical User Interfaces
- "Here's Looking at You, Kid"
- Python GUI Development Options
- Tkinter Overview
- Climbing the GUI Learning Curve
- The End of the Tutorial
- Python/Tkinter for Tcl/Tk Converts
-
Chapter 7 A Tkinter Tour, Part 1
- "Widgets and Gadgets and GUIs, Oh My!"
- Configuring Widget Appearance
- Toplevel Windows
- Dialogs
- Binding Events
- Message and Entry
- Checkbutton, Radiobutton, and Scale
- Running GUI Code Three Ways
- Images
-
Chapter 8 A Tkinter Tour, Part 2
- "On Today's Menu: Spam, Spam, and Spam"
- Menus
- Listboxes and Scrollbars
- Text
- Canvas
- Grids
- Time Tools, Threads, and Animation
- The End of the Tour
- The PyDemos and PyGadgets Launchers
-
Chapter 9 Larger GUI Examples
- "Building a Better Mouse Trap"
- Advanced GUI Coding Techniques
- Complete Program Examples
- PyEdit: A Text Editor Program/Object
- PyView: An Image and Notes Slideshow
- PyDraw: Painting and Moving Graphics
- PyClock: An Analog/Digital Clock Widget
- PyToe: A Tic-Tac-Toe Game Widget
- Where to Go from Here
-
Internet Scripting
-
Chapter 10 Network Scripting
- "Tune in, Log on, and Drop out"
- Plumbing the Internet
- Socket Programming
- Handling Multiple Clients
- A Simple Python File Server
-
Chapter 11 Client-Side Scripting
- "Socket to Me!"
- Transferring Files over the Net
- Processing Internet Email
- The PyMailGui Email Client
- Other Client-Side Tools
-
Chapter 12 Server-Side Scripting
- "Oh What a Tangled Web We Weave"
- What's a Server-Side CGI Script?
- Climbing the CGI Learning Curve
- The Hello World Selector
- Coding for Maintainability
- More on HTML and URL Escapes
- Sending Files to Clients and Servers
-
Chapter 13 Larger Web Site Examples I
- "Things to Do When Visiting Chicago"
- The PyMailCgi Web Site
- The Root Page
- Sending Mail by SMTP
- Reading POP Email
- Utility Modules
- CGI Script Trade-offs
-
Chapter 14 Larger Web Site Examples II
- "Typos Happen"
- The PyErrata Web Site
- The Root Page
- Browsing PyErrata Reports
- Submitting PyErrata Reports
- PyErrata Database Interfaces
- Administrative Tools
- Designing for Reuse and Growth
-
Chapter 15 Advanced Internet Topics
- "Surfing on the Shoulders of Giants"
- Zope: A Web Publishing Framework
- HTMLgen: Web Pages from Objects
- JPython ( Jython): Python for Java
- Grail: A Python-Based Web Browser
- Python Restricted Execution Mode
- XML Processing Tools
- Windows Web Scripting Extensions
- Python Server Pages
- Rolling Your Own Servers in Python
-
Assorted Topics
-
Chapter 16 Databases and Persistence
- "Give Me an Order of Persistence, but Hold the Pickles"
- Persistence Options in Python
- DBM Files
- Pickled Objects
- Shelve Files
- SQL Database Interfaces
- PyForm: A Persistent Object Viewer
-
Chapter 17 Data Structures
- "Roses Are Red, Violets Are Blue; Lists Are Mutable, and So Is Class Foo"
- Implementing Stacks
- Implementing Sets
- Binary Search Trees
- Graph Searching
- Reversing Sequences
- Permuting Sequences
- Sorting Sequences
- Data Structures Versus Python Built-ins
- PyTree: A Generic Tree Object Viewer
-
Chapter 18 Text and Language
- "See Jack Hack. Hack, Jack, Hack"
- Strategies for Parsing Text in Python
- String Module Utilities
- Regular Expression Matching
- Parser Generators
- Hand-Coded Parsers
- PyCalc: A Calculator Program/Object
-
Integration
-
Chapter 19 Extending Python
- "I Am Lost at C"
- C Extensions Overview
- A Simple C Extension Module
- The SWIG Integration Code Generator
- Wrapping C Environment Calls
- A C Extension Module String Stack
- A C Extension Type String Stack
- Wrapping C++ Classes with SWIG
-
Chapter 20 Embedding Python
- "Add Python. Mix Well. Repeat."
- C Embedding API Overview
- Basic Embedding Techniques
- Registering Callback Handler Objects
- Using Python Classes in C
- ppembed: A High-Level Embedding API
- Other Integration Topics
-
The End
-
Chapter 21 Conclusion: Python and the Development Cycle
- "That's the End of the Book, Now Here's the Meaning of Life"
- "Something's Wrong with the Way We Program Computers"
- The "Gilligan Factor"
- Doing the Right Thing
- Enter Python
- But What About That Bottleneck?
- On Sinking the Titanic
- So What's Python: The Sequel
- In the Final Analysis...
- Postscript to the Second Edition
-
Appendix A Recent Python Changes
- Major Changes in 2.0
- Major Changes in 1.6
- Major Changes Between 1.3 and 1.5.2
-
Appendix B Pragmatics
- Installing Python
- Book Examples Distribution
- Environment Configuration
- Running Python Programs
- Python Internet Resources
-
Appendix C Python Versus C++
-
Colophon
Return to Programming Python