Programming Python 2nd Ed.

Solutions for Python Programmers

Mark Lutz

Publisher: O'Reilly, 2001, 1255 pages

ISBN: 0-596-00085-5

Keywords: Python

Last modified: Nov. 9, 2008, 11:25 a.m.

Covers Python 2

Since the first edition of Programming Python was published, Python has evolved into a widely accepted programming language for many important tasks, ranging from commercial Linux installation scripts and web application programming to movie animation and special effects. Youll find Python powering web portals, serving up maps and directories on the Internet, running online games, managing discussion forums, testing chips and boards, and controlling wireless networking products.

Python is available on all important computing platforms, including major commercial versions of Unix, Linux, Windows, and Mac OS. You can do almost anything with Python that you do with C++, but Python is an interpreted language designed for rapid application development and deployment. Among other features, Python offers object-oriented programming support; a simple, readable, and maintainable syntax; integration with C components; and a vast collection of precoded interfaces and utilities.

This book, the second edition of the best-selling Python book to date, is the most comprehensive resource available today for serious Python programmers. Reviewed and endorsed by Python creator Guido van Rossum (who also wrote the Foreword), the second edition of Programming Python focuses on real-world Python applications. Readers will find that this book is actually four books in one, with in-depth coverage of Internet scripting, systems programming, GUI programming including Tkinter, and C integration. Most importantly, the book covers Python 2.0, the first new major release of Python in five years. It also covers new Python tools and applications, including Jython, a version of Python that compiles as Java bytecode; Active Scripting and COM extensions; Zope, an open source web application system; the HTMLgen and SWIG code generators; thread support; and the CGI and Internet protocol modules. This book also provides a wealth of code examples, so that you can start developing advanced Python applications today.

This edition includes a platform-neutral CD-ROM filled with examples from the book, the full Python 2.0 source code distribution, and other Python-related packages such as the Zope web application framework, SWIG and HTMLgen code generators, and PMW megawidgets library- all for PC, Macintosh, and Unix platforms.

    • 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?
  • Part I: 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
  • Part II: 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
  • Part III: 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
  • Part IV: 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
  • Part V: 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
  • Part VI: 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++

Reviews

Programming Python

Reviewed by Roland Buresund

Disappointing *** (3 out of 10)

Last modified: June 12, 2008, 6:16 p.m.

Really technical, but misses the point.

It is deeply technical, but doesn't convey any insights. Neither does it describe any real problem-solving approach with Python. It is just some examples thrown together rather haphazardly.

I was deeply disappointed.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required