| Acknowledgments | p. xxiii |
| Introduction | p. xxv |
| Fundamentals of the Language | |
| Introducing Python | p. 3 |
| What Is Python? | p. 4 |
| What Is Python Good For? | p. 6 |
| What Isn't Python Good For? | p. 9 |
| Who Uses Python? | p. 9 |
| Python History | p. 10 |
| Similar Languages | p. 12 |
| Python Fundamentals | p. 19 |
| Executing Python Programs | p. 20 |
| Script, Program, or Module? | p. 31 |
| Components of a Python Program | p. 33 |
| Built-in Object Types | p. 34 |
| Statements | p. 69 |
| Functions | p. 81 |
| Function Definition and Execution | p. 83 |
| Scoping | p. 84 |
| Arguments | p. 88 |
| Return Values | p. 95 |
| Advanced Function Calling | p. 96 |
| Modules | p. 101 |
| Importing a Module | p. 102 |
| Tricks for Importing Modules | p. 106 |
| Packages | p. 109 |
| Creating a Module | p. 111 |
| Object Orientation | p. 113 |
| Creating a Class | p. 114 |
| Exceptions and Error Trapping | p. 125 |
| What Is an Exception? | p. 127 |
| What Happens When an Exception Occurs? | p. 128 |
| Exception Handling | p. 131 |
| Built-In Exceptions | p. 138 |
| Rolling Your Own Exceptions | p. 144 |
| Applying the Python Libraries | |
| Python's Built-In Functions | p. 149 |
| Interfacing to the OS | p. 169 |
| Working with the System (sys Module) | p. 170 |
| Working with the Operating System (os Module) | p. 176 |
| Multithreading | p. 191 |
| Processing Information | p. 207 |
| Manipulating Numbers | p. 208 |
| Text Manipulation | p. 214 |
| Time | p. 232 |
| Data Types and Operators | p. 239 |
| Unicode Strings | p. 247 |
| Working with Files | p. 257 |
| File Processing | p. 258 |
| Controlling File I/O | p. 266 |
| Getting File Lists | p. 269 |
| Basic File/Directory Management | p. 270 |
| Access and Ownership | p. 272 |
| Manipulating File Paths | p. 275 |
| Data Management and Storage | p. 277 |
| Managing Internal Structures | p. 278 |
| Object Persistence | p. 281 |
| Communicating over a Network | p. 289 |
| Networking 101 | p. 290 |
| Obtaining Networking Information | p. 294 |
| Basic Socket Functions | p. 295 |
| Creating a Network Server | p. 302 |
| Client Modules | p. 307 |
| Handling Internet Data | p. 314 |
| Using Python for Multimedia | p. 329 |
| Audio Modules | p. 330 |
| Graphics Modules | p. 345 |
| Interface Building with Tk | p. 351 |
| Installing Python/Tk under Unix | p. 353 |
| Installing Python/Tk under Windows | p. 354 |
| Installing Python/Tk under MacOS | p. 354 |
| Introduction to Tk | p. 354 |
| Using Widgets | p. 361 |
| Controlling Window Geometry | p. 388 |
| Application Development | |
| Using Python as a RAD Tool | p. 395 |
| What RAD Really Is | p. 396 |
| Why Python? | p. 400 |
| Application Development with Python | p. 405 |
| Integrated Development Environments | p. 406 |
| Python Standard Library | p. 413 |
| Vaults of Parnassus | p. 420 |
| Zope and Jython | p. 420 |
| Distributing Python Modules | p. 421 |
| Using distutils | p. 423 |
| Future Features | p. 424 |
| Web Development | |
| Web Development Basics | p. 427 |
| Writing HTML | p. 428 |
| Uniform Resource Locators | p. 430 |
| Dynamic Websites Using CGI | p. 432 |
| Cookies | p. 448 |
| Security | p. 451 |
| Standard Markup Language Processing | p. 453 |
| Processing SGML | p. 455 |
| Processing HTML | p. 455 |
| Processing XML | p. 460 |
| Other Python Web Tools | p. 471 |
| Zope, the Z-Objects Publishing Environment | p. 472 |
| Jython | p. 475 |
| Python.NET | p. 478 |
| Python Server Pages | p. 479 |
| Python and ActiveScript | p. 480 |
| Mailman | p. 480 |
| Grail | p. 481 |
| Apache and Python | p. 481 |
| SocketServer and BaseHTTPServer | p. 482 |
| Medusa | p. 483 |
| Cross-platform Development | |
| Paths to Cross-platform Development | p. 487 |
| Basic Platform Support | p. 488 |
| Execution Environment | p. 489 |
| Line Termination | p. 497 |
| Character Sets | p. 498 |
| Files and Pathnames | p. 499 |
| Data Differences | p. 499 |
| Performance and Resources | p. 500 |
| Inside Python | |
| The Python Architecture | p. 503 |
| Namespaces, Code Blocks, and Frames | p. 505 |
| Built-in Types | p. 509 |
| Bytecode | p. 517 |
| Debugging and Tuning | p. 533 |
| An Introduction to Debugging | p. 534 |
| Debugging Techniques | p. 542 |
| Optimizing Python Applications | p. 556 |
| Documenting and Documentation | p. 567 |
| Comments | p. 568 |
| Embedded Document Strings | p. 571 |
| Translating Embedded Strings into Documentation | p. 573 |
| Extending Python | p. 581 |
| Basic Interface | p. 582 |
| Data Conversion | p. 589 |
| Managing Reference Counts | p. 592 |
| Exceptions | p. 594 |
| Low-Level Object Access | p. 600 |
| Where Next? | p. 609 |
| Embedding Python | p. 611 |
| Embedding Principles | p. 612 |
| Python Embedding Types | p. 620 |
| Where Next? | p. 629 |
| Python Library Guide | p. 631 |
| Python Resources | p. 659 |
| Web Resources | p. 660 |
| Email, Newsgroup, and Mailing List Resources | p. 663 |
| Online Documentation | p. 664 |
| Print Resources | p. 665 |
| Index | p. 667 |
| Table of Contents provided by Syndetics. All Rights Reserved. |