You are here: Home Dive Into Python 3

Table of Contents

  1. What’s New In “Dive Into Python 3”
  2. Installing Python
    1. Diving In
    2. Which Python Is Right For You?
    3. Installing on Microsoft Windows
    4. Installing on Mac OS X
    5. Installing on Ubuntu Linux
    6. Installing on Other Platforms
    7. Using The Python Shell
    8. Python Editors and IDEs
  3. Your first Python program
    1. Diving in
    2. Declaring functions
    3. Writing readable code
      1. Docstrings
    4. Everything is an object
      1. The import search path
      2. What’s an object?
    5. Indenting code
    6. Exceptions
    7. Running scripts
    8. Further reading
  4. Native Python datatypes
    1. Diving in
    2. Booleans
    3. Numbers
      1. Coercing integers to floats and vice-versa
      2. Common numerical operations
      3. Fractions
      4. Trigonometry
      5. Numbers in a boolean context
    4. Lists
      1. Creating a list
      2. Slicing a list
      3. Adding items to a list
      4. Searching for values in a list
      5. Lists in a boolean context
    5. Dictionaries
      1. Creating a dictionary
      2. Modifying a dictionary
      3. Mixed-value dictionaries
      4. Dictionaries in a boolean context
    6. None
      1. None in a boolean context
    7. Further reading
  5. Strings
    1. Diving in
    2. Unicode
      1. How strings are stored in memory
      2. Converting between different character encodings
      3. Specifying character encoding in .py files
    3. Strings in Python 3
    4. Common string operations
    5. Formatting strings
    6. The string module
    7. Strings vs. bytes
    8. Further reading
  6. Regular expressions
    1. Diving in
    2. Case study: street addresses
    3. Case study: Roman numerals
      1. Checking for thousands
      2. Checking for hundreds
    4. Using the {n,m} Syntax
      1. Checking for tens and ones
    5. Verbose regular expressions
    6. Case study: parsing phone numbers
    7. Summary
  7. Closures & Generators
    1. Diving in
    2. I know, let’s use regular expressions!
    3. A list of functions
    4. A list of patterns
    5. A file of patterns
    6. Generators
      1. A Fibonacci generator
      2. A plural rule generator
  8. Classes & Iterators
    1. Diving In
    2. Defining Classes
    3. Instantiating Classes
    4. Instance Variables
    5. A Fibonacci iterator
    6. A Plural Rule Iterator
    7. Further Reading
  9. Advanced Iterators
    1. Diving In
    2. Finding all occurrences of a pattern
    3. Finding the unique items in a sequence
    4. Making assertions
    5. Generator expressions
    6. Calculating Permutations… The Lazy Way!
    7. Other Fun Stuff in the itertools Module
    8. A New Kind Of String Manipulation
    9. Evaluating Arbitrary Strings As Python Expressions
    10. Putting It All Together
    11. Further Reading
  10. Unit testing
    1. (Not) diving in
    2. A single question
    3. “Halt and catch fire”
    4. More halting, more fire
    5. ...
  11. Advanced Unit Testing
    1. ...
  12. Refactoring your code
    1. Diving in
    2. Handling changing requirements
    3. Refactoring
    4. Summary
  13. Advanced Classes
    1. Diving in
  14. Files
    1. File objects
    2. Reading files
    3. Close your files... or don't
    4. Handling errors (exceptions)
    5. Writing to files
  15. XML
    1. Diving In
    2. A 5-Minute Crash Course in XML
    3. The Structure Of An Atom Feed
    4. Parsing XML
      1. Elements Are Lists
      2. Attributes Are Dictonaries
    5. Searching For Nodes Within An XML Document
    6. Going Further With lxml
      1. Customizing Your XML Parser
      2. Incremental Parsing
    7. Generating XML
    8. Further Reading
  16. Serializing Python Objects
  17. HTTP Web Services
    1. Diving In
    2. Features of HTTP
      1. Caching
      2. Last-Modified Checking
      3. ETags
      4. Compression
      5. Redirects
    3. How Not To Fetch Data Over HTTP
    4. What’s On The Wire?
    5. Introducing httplib2
      1. How httplib2 Handles Caching
      2. How httplib2 Handles Last-Modified and ETag Headers
      3. How http2lib Handles Compression
      4. How httplib2 Handles Redirects
    6. Beyond HTTP GET
    7. Beyond HTTP POST
    8. Further Reading
  18. Threading & Multiprocessing
  19. Packaging Python libraries
    1. A brief history of packaging (and why it's harder than you think)
    2. setuptools
    3. distutils
    4. Eggs
    5. pip
    6. Platform-specific packaging
      1. Packaging by Linux distributions
      2. Py2exe
  20. Case study: porting chardet to Python 3
    1. Introducing chardet: a mini-FAQ
      1. What is character encoding auto-detection?
      2. Isn’t that impossible?
      3. Who wrote this detection algorithm?
      4. Yippie! Screw the standards, I’ll just auto-detect everything!
      5. Why bother with auto-detection if it’s slow, inaccurate, and non-standard?
    2. Diving in
      1. UTF-n with a BOM
      2. Escaped encodings
      3. Multi-byte encodings
      4. Single-byte encodings
      5. windows-1252
    3. Running 2to3
    4. Fixing what 2to3 can’t
      1. False is invalid syntax
      2. No module named constants
      3. Name 'file' is not defined
      4. Can’t use a string pattern on a bytes-like object
      5. Can’t convert 'bytes' object to str implicitly
  21. Where to go from here
    1. Things to read
    2. Where to look for Python 3-compatible code

Orphans (not sure where these belong yet):

© 2001–9 Mark Pilgrim