| Chapter 1 | Introduction to Python |
| Perl Backgrounder |
| Python Backgrounder |
| More About Python |
| | Python is Portable |
| | Python is Powerful |
| | Python is Extensible |
| | Python is Easy |
| What is it good for? |
| | Mathematics |
| | Text Processing |
| | Rapid Application Development |
| | Cross Platform Development |
| | System Utilities |
| | Internet Programming |
| | Database Programming |
| | Everything Else |
| What isn't it good for? |
| Who uses it? |
| Chapter 2 | Executing Python Programs |
| Interactively |
| Execution from a File |
| | As a Unix Script |
| | On a Windows Host |
| | On a MacOS Host |
| Other Methods |
| Chapter 3 | Python Overview |
| Basic Structure |
| | Python's Approach |
| Variables, Data and Objects |
| | Python's Approach |
| Statements and Expressions |
| Built-in Functions |
| | Python's Approach |
| Modules |
| | Python's Approach |
| The Execution Model |
| | Perl |
| | Python |
| Chapter 4 | Components of a Python Program |
| The Basics |
| | Line Format |
| | Comments |
| | Contexts |
| | Using print |
| Python Variables |
| | Numbers |
| | Strings |
| | Lists |
| | Tuples |
| | Dictionaries |
| | Files |
| Object Oddities |
| Python Operators |
| | Numeric Operators |
| | Sequence Operators |
| | Formatting Operator |
| | Assignments |
| | Comparing Objects |
| | Loops and Control Statements |
| Chapter 5 | Functions |
| Basic Function Definition |
| | Default Values |
| | Passing Sequences and Dictionaries |
| | Variable Arguments |
| | Keyword Arguments |
| | Freeform Arguments |
| | Prototypes |
| | Arguments Are References |
| | Return Values |
| | Scope |
| | Nested Definitions |
| Advanced Function Calling |
| | Indirect Function Calls |
| | Anonymous Functions |
| Chapter 6 | Exceptions and Error Trapping |
| Error Trapping in Perl |
| Error Trapping in Python |
| The Exception System |
| Exception Handlers |
| | try - except - else |
| | try - finally |
| | Exception Propagation |
| | Raising Exceptions |
| | The assert Statement |
| Built-in Exceptions |
| | Exception |
| | StandardError |
| | ArithmeticError |
| | AssertionError |
| | AttributeError |
| | EnvironmentError |
| | EOFError |
| | FloatingPointError |
| | ImportError |
| | IndexError |
| | IOError |
| | KeyError |
| | KeyboardInterrupt |
| | LookupError |
| | MemoryError |
| | NameError |
| | NotImplementedError |
| | OSError |
| | OverflowError |
| | RuntimeError |
| | SyntaxError |
| | SystemError |
| | SystemExit |
| | TypeError |
| | UnboundLocalError |
| | UnicodeError |
| | ValueError |
| | WindowsError |
| | ZeroDivisionError |
| Creating New Exception Classes |
| Chapter 7 | Modules, Classes and Object Orientation |
| Modules |
| | Namespaces |
| | Importing a Module |
| | Creating a New Module |
| | Python module Tricks |
| | Packages |
| Classes |
| | Creating A Class |
| | Additional Class Methods |
| | Class Inheritance |
| Chapter 8 | Python Built-in Functions |
| Perl to Python Traps |
| | abs(x) |
| | apply(function, args [, keywords ]) |
| | buffer(object [, offset [, size ] ]) |
| | callable(object) |
| | chr(i) |
| | cmp(x, y) |
| | coerce(x, y) |
| | compile(string, filename, kind) |
| | complex(real [, imag ]) |
| | delattr(object, name) |
| | dir( [object ]) |
| | divmod(a, b) |
| | eval(expression [, globals [, locals ] ]) |
| | execfile(file [, globals [, locals ] ]) |
| | filter(function, list) |
| | float(x) |
| | getattr(object, name [, default ]) |
| | globals() |
| | hasattr(object, name) |
| | hash(object) |
| | hex(x) |
| | id(object) |
| | input( [prompt ]) |
| | int(x [, radix ]) |
| | intern(string) |
| | isinstance(object, class) |
| | issubclass(class1, class2) |
| | len(s) |
| | list(sequence) |
| | locals() |
| | long(x) |
| | map(function, list, ...) |
| | max(s [, args... ]) |
| | min(s [, args... ]) |
| | oct(x) |
| | open(filename [, mode [, bufsize ] ]) |
| | ord(c) |
| | pow(x, y [, z ]) |
| | range( [start, ] stop [, step ]) |
| | raw input([prompt ]) |
| | reduce(function, sequence [, initializer ]) |
| | reload(module) |
| | repr(object) |
| | round(x[, n ]) |
| | setattr(object, name, value) |
| | slice( [start, ] stop [, step ]) |
| | str(object) |
| | tuple(sequence) |
| | type(object) |
| | unichr(i) |
| | unicode(string [, encoding [, errors ] ]) |
| | vars( [object ]) |
| | xrange( [start, ] stop [, step ]) |
| | zip(seq1, ...) |
| Chapter 9 | Interfacing with the Operating System |
| Communicating with the System |
| | Getting Command-line Arguments |
| | Standard Filehandles |
| | Terminating Execution |
| | Determining the Interpreter Version |
| | Determining the Interpreter Location |
| | Discovering the Currently Loaded Modules |
| | Modifying the Library Search Path |
| | Other Variables in the sys Module |
| Working with the Operating System |
| | Manipulating Environment Variables |
| | Line Termination |
| | Process Environment |
| | Process Execution and Management |
| | User/Group Information |
| | File Management |
| Chapter 10 | Data Manipulation |
| Basic String Handling |
| | Finding String Segments |
| | Extracting String Segments |
| | Replacing String Segments |
| | Splitting |
| | Joining |
| | Trimming |
| | Changing Case |
| | Translating Characters |
| Regular Expressions |
| | Basic Searches/Matches |
| | Extracting Matched Components |
| | Using MatchObject |
| | Substitution |
| | Using Compiled Regular Expressions |
| | Escaping Strings |
| Sorting Sequences |
| | Sorting Tuples |
| | Sorting Dictionaries |
| | Sort Functions |
| Copying Variables |
| External Data Sources |
| | DBM Databases |
| | Storing Objects |
| | Commercial Databases |
| Chapter 11 | File Manipulation |
| File Processing |
| | Reading |
| | Writing |
| | Changing Position |
| File Management |
| | Getting File Lists |
| | Moving, Renaming, Deleting Files/Directories |
| | Access and Ownership |
| | Getting File Information |
| | Manipulating File Paths |
| Chapter 12 | Communicating Over A Network |
| Basic Socket Functions |
| Running A Server |
| Obtaining Networking Information |
| Client Modules |
| | Working With SMTP |
| | Working with HTTP |
| | Working with IMAP |
| Chapter 13 | Web Development |
| Basic CGI Programming |
| | Generating HTML |
| Handling Cookies |
| URL Processing |
| Zope |
| Chapter 14 | GUI Development with Tk |
| Basic Operations |
| | Creating Widgets |
| | Setting Properties |
| | Widget Variables |
| | Widget Callbacks |
| | Widget Geometry |
| Dialog Box Sample |
| Appendix A | |
| Appendix B | Perl to Python Quick Reference |