Table of Contents
Introduction
Book Conventions
Python Command-Line Usage
Python Command Options
Command-Line Program Specification
Python 2.X Command Options
Python Environment Variables
Operational Variables
Python Command Option Variables
Python Windows Launcher Usage
Launcher File Directives
Launcher Command Lines
Launcher Environment Variables
Built-in Types and Operators
Operators and Precedence
Operator Usage Notes
Operations by Category
Sequence Operation Notes
Specific Built-in Types
Numbers
Strings
Unicode Strings
Lists
Dictionaries
Tuples
Files
Sets
Other Types and Conversions
Statements and Syntax
Syntax Rules
Name Rules
Specific Statements
The Assignment Statement
The Expression Statement
The print Statement
The if Statement
The while Statement
The for Statement
The pass Statement
The break Statement
The continue Statement
The del Statement
The def Statement
The return Statement
The yield Statement
The global Statement
The nonlocal Statement
The import Statement
The from Statement
The class Statement
The try Statement
The raise Statement
The assert Statement
The with Statement
Python 2.X Statements
Namespace and Scope Rules
Qualified Names: Object Namespaces
Unqualified Names: Lexical Scopes
Nested Scopes and Closures
Object-Oriented Programming
Classes and Instances
Pseudoprivate Attributes
New-Style Classes
Formal Inheritance Rules
Operator Overloading Methods
Methods for All Types
Methods for Collections (Sequences, Mappings)
Methods for Numbers (Binary Operators)
Methods for Numbers (Other Operations)
Methods for Descriptors
Methods for Context Managers
Python 2.X Operator Overloading Methods
Built-in Functions
Python 2.X Built-in Functions
Built-in Exceptions
Superclasses: Categories
Specific Exceptions
Specific OSError Exceptions
Warning Category Exceptions
Warnings Framework
Python 3.2 Built-in Exceptions
Python 2.X Built-in Exceptions
Built-in Attributes
Standard Library Modules
The sys Module
The string Module
Functions and Classes
Constants
The os System Module
Administrative Tools
Portability Constants
Shell Commands
Environment Tools
File Descriptor Tools
File Pathname Tools
Process Control
The os.path Module
The re Pattern-Matching Module
Module Functions
Regular Expression Objects
Match Objects
Pattern Syntax
Object Persistence Modules
The shelve and dbm Modules
The pickle Module
The tkinter GUI Module and Tools
tkinter Example
tkinter Core Widgets
Common Dialog Calls
Additional tkinter Classes and Tools
Tcl/Tk-to-Python/tkinter Mappings
Internet Modules and Tools
Other Standard Library Modules
The math Module
The time Module
The timeit Module
The datetime Module
The random Module
The json Module
The subprocess Module
The enum Module
The struct Module
Threading Modules
Python SQL Database API
API Usage Example
Module Interface
Connection Objects
Cursor Objects
Type Objects and Constructors
More Hints and Idioms
Core Language Hints
Environment Hints
Usage Hints
Assorted Hints
Index