Books & Videos

Table of Contents

  1. Getting Started

    1. Chapter 1 A Python Q&A Session

      1. Why Do People Use Python?
      2. Is Python a "Scripting Language"?
      3. OK, but What's the Downside?
      4. Who Uses Python Today?
      5. What Can I Do with Python?
      6. What Are Python's Technical Strengths?
      7. How Does Python Stack Up to Language X?
      8. Chapter Summary
    2. Chapter 2 How Python Runs Programs

      1. Introducing the Python Interpreter
      2. Program Execution
      3. Execution Model Variations
      4. Chapter Summary
    3. Chapter 3 How You Run Programs

      1. Interactive Coding
      2. System Command Lines and Files
      3. Clicking File Icons
      4. Module Imports and Reloads
      5. The IDLE User Interface
      6. Other IDEs
      7. Embedding Calls
      8. Frozen Binary Executables
      9. Text Editor Launch Options
      10. Other Launch Options
      11. Future Possibilities?
      12. Which Option Should I Use?
      13. Chapter Summary
      14. BRAIN BUILDER
  2. Types and Operations

    1. Chapter 4 Introducing Python Object Types

      1. Why Use Built-in Types?
      2. Numbers
      3. Strings
      4. Lists
      5. Dictionaries
      6. Tuples
      7. Files
      8. Other Core Types
      9. Chapter Summary
    2. Chapter 5 Numbers

      1. Python Numeric Types
      2. Python Expression Operators
      3. Numbers in Action
      4. Other Numeric Types
      5. Chapter Summary
    3. Chapter 6 The Dynamic Typing Interlude

      1. The Case of the Missing Declaration Statements
      2. Shared References
      3. Dynamic Typing Is Everywhere
      4. Chapter Summary
    4. Chapter 7 ofsmallStrings

      1. String Literals
      2. Strings in Action
      3. String Formatting
      4. String Methods
      5. General Type Categories
      6. Chapter Summary
    5. Chapter 8 Lists and Dictionaries

      1. Lists
      2. Lists in Action
      3. Dictionaries
      4. Dictionaries in Action
      5. Chapter Summary
    6. Chapter 9 Tuples, Files, and Everything Else

      1. Tuples
      2. Files
      3. Type Categories Revisited
      4. Object Flexibility
      5. References Versus Copies
      6. Comparisons, Equality, and Truth
      7. Python's Type Hierarchies
      8. Other Types in Python
      9. Built-in Type Gotchas
      10. Chapter Summary
      11. BRAIN BUILDER
  3. Statements and Syntax

    1. Chapter 10 Introducing Python Statements

      1. Python Program Structure Revisited
      2. A Tale of Two ifs
      3. A Quick Example: Interactive Loops
      4. Chapter Summary
    2. Chapter 11 rwordsAssignment, Expressions, and print

      1. Assignment Statements
      2. Expression Statements
      3. print Statements
      4. Chapter Summary
    3. Chapter 12 if Tests

      1. if Statements
      2. Python Syntax Rules
      3. Truth Tests
      4. Chapter Summary
    4. Chapter 13 while and for Loops

      1. while Loops
      2. break, continue, pass, and the Loop else
      3. for Loops
      4. Iterators: A First Look
      5. Loop Coding Techniques
      6. List Comprehensions: A First Look
      7. Chapter Summary
    5. Chapter 14 The Documentation Interlude

      1. Python Documentation Sources
      2. Common Coding Gotchas
      3. Chapter Summary
      4. BRAIN BUILDER
  4. Functions

    1. Chapter 15 Function Basics

      1. Why Use Functions?
      2. A First Example: Definitions and Calls
      3. A Second Example: Intersecting Sequences
      4. Chapter Summary
    2. Chapter 16 Scopes and Arguments

      1. Scope Rules
      2. The global Statement
      3. Scopes and Nested Functions
      4. Passing Arguments
      5. Special Argument-Matching Modes
      6. Chapter Summary
    3. Chapter 17 Advanced Function Topics

      1. Anonymous Functions: lambda
      2. Applying Functions to Arguments
      3. Mapping Functions over Sequences: map
      4. Functional Programming Tools: filter and reduce
      5. List Comprehensions Revisited: Mappings
      6. Iterators Revisited: Generators
      7. Timing Iteration Alternatives
      8. Function Design Concepts
      9. Function Gotchas
      10. Chapter Summary
      11. BRAIN BUILDER
  5. Modules

    1. Chapter 18 Modules: The Big Picture

      1. Why Use Modules?
      2. Python Program Architecture
      3. How Imports Work
      4. Chapter Summary
    2. Chapter 19 Module Coding Basics

      1. Module Creation
      2. Module Usage
      3. Module Namespaces
      4. Reloading Modules
      5. Chapter Summary
    3. Chapter 20 Module Packages

      1. Package Import Basics
      2. Package Import Example
      3. Why Use Package Imports?
      4. Chapter Summary
    4. Chapter 21 Advanced Module Topics

      1. Data Hiding in Modules
      2. Enabling Future Language Features
      3. Mixed Usage Modes: _ _name_ _ and _ _main_ _
      4. Changing the Module Search Path
      5. The import as Extension
      6. Relative Import Syntax
      7. Module Design Concepts
      8. Module Gotchas
      9. Chapter Summary
      10. BRAIN BUILDER
  6. Classes and OOP

    1. Chapter 22 OOP: The Big Picture

      1. Why Use Classes?
      2. OOP from 30,000 Feet
      3. Chapter Summary
    2. Chapter 23 Class Coding Basics

      1. Classes Generate Multiple Instance Objects
      2. Classes Are Customized by Inheritance
      3. Classes Can Intercept Python Operators
      4. The World's Simplest Python Class
      5. Chapter Summary
    3. Chapter 24 Class Coding Details

      1. The class Statement
      2. Methods
      3. Inheritance
      4. Operator Overloading
      5. Namespaces: The Whole Story
      6. A More Realistic Example
      7. Chapter Summary
    4. Chapter 25 Designing with Classes

      1. Python and OOP
      2. Classes As Records
      3. OOP and Inheritance: "Is-a" Relationships
      4. OOP and Composition: "Has-a" Relationships
      5. OOP and Delegation
      6. Multiple Inheritance
      7. Classes Are Objects: Generic Object Factories
      8. Methods Are Objects: Bound or Unbound
      9. Documentation Strings Revisited
      10. Classes Versus Modules
      11. Chapter Summary
    5. Chapter 26 Advanced Class Topics

      1. Extending Built-in Types
      2. Pseudoprivate Class Attributes
      3. New-Style Classes
      4. Static and Class Methods
      5. Function Decorators
      6. Class Gotchas
      7. Chapter Summary
      8. BRAIN BUILDER
  7. Exceptions and Tools

    1. Chapter 27 Exception Basics

      1. Why Use Exceptions?
      2. Exception Handling: The Short Story
      3. The try/except/else Statement
      4. The try/finally Statement
      5. Unified try/except/finally
      6. The raise Statement
      7. The assert Statement
      8. with/as Context Managers
      9. Chapter Summary
    2. Chapter 28 Exception Objects

      1. String-Based Exceptions
      2. Class-Based Exceptions
      3. General raise Statement Forms
      4. Chapter Summary
    3. Chapter 29 Designing with Exceptions

      1. Nesting Exception Handlers
      2. Exception Idioms
      3. Exception Design Tips
      4. Exception Gotchas
      5. Core Language Summary
      6. Chapter Summary
      7. BRAIN BUILDER
  8. Appendixes

    1. Appendix Installation and Configuration

      1. Installing the Python Interpreter
      2. Configuring Python
    2. Appendix Solutions to End-of-Part Exercises

      1. Part I, Getting Started
      2. Part II, Types and Operations
      3. Part III, Statements and Syntax
      4. Part IV, Functions
      5. Part V, Modules
      6. Part VI, Classes and OOP
      7. Part VII, Exceptions and Tools
  1. Colophon