Table of contents

  1. Installing Python
    1. Python on Windows
    2. Python on Mac OS X
    3. Python on Ubuntu Linux
    4. Python from source
    5. The interactive shell
  2. Your first Python program
    1. Diving in
    2. Declaring functions
    3. Writing readable code
      1. Docstrings
      2. Function annotations
      3. Style conventions
    4. Everything is an object
      1. The import search path
      2. What's an object?
    5. Indenting code
    6. Running scripts
    7. Further reading
  3. Native Python datatypes
    1. Diving in
    2. Booleans
    3. Numbers
    4. Lists
    5. Dictionaries
    6. None
    7. Further reading
  4. Strings
    1. There ain't no such thing as plain text
      1. A brief history of character encoding
      2. What's a character?
      3. How strings are stored in memory
      4. Converting between different character encodings
    2. Formatting strings
    3. What's my string?
    4. Lists and strings
    5. Historical note on the string module
    6. Byte streams
    7. Summary
  5. 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
  6. The power of introspection
    1. Diving in
    2. Using optional and named arguments
      1. Keyword-only arguments
    3. Using type, str, dir, and other built-in functions
      1. The type function
      2. The str function
      3. Built-in functions
    4. Getting object references with getattr
      1. getattr with modules
      2. getattr as a dispatcher
    5. Filtering lists
    6. Using lambda functions
    7. Putting it all together
    8. Summary
  7. Objects and object-orientation
    1. ...major changes afoot...
    2. ...stuff about decorators...
    3. ...stuff about importing modules...
      1. ...mention why from module import * is only allowed at module level
  8. Unit testing
    1. (Not) diving in
    2. A single question
    3. “Halt and catch fire”
    4. More halting, more fire
    5. ...
  9. Test-first programming
    1. ...
  10. Refactoring your code
    1. Handling bugs
    2. Handling changing requirements
    3. The art of refactoring
    4. Postscript
    5. Summary
  11. Files
    1. File objects
    2. Reading files
    3. Close your files... or don't
    4. Handling errors (exceptions)
    5. Writing to files
  12. HTML processing
    1. Diving in
    2. html5lib
      1. Installing html5lib
      2. Using html5lib
    3. Extracting data from HTML documents
    4. Building HTML documents
    5. Putting it all together
    6. Summary
  13. XML Processing
    1. ...major changes afoot...
  14. HTTP web services
    1. Diving in
    2. How not to fetch data over HTTP
    3. Features of HTTP
      1. User-Agent
      2. Redirects
      3. Last-Modified/If-Modified-Since
      4. ETag-If-None-Match
      5. Compression
    4. Differences from Python 2
    5. httplib2 (note: needs port)
      1. Installing httplib2
      2. Why httplib2 is better than http.client
    6. Debugging HTTP web services
    7. Setting the User-Agent
    8. Handling Last-Modified and ETag
    9. Handling redirects
    10. Handling compressed data
    11. Putting it all together
    12. Summary
  15. Dynamic functions
    1. Diving in
    2. plural.py, stage 1
    3. plural.py, stage 2
    4. plural.py, stage 3
    5. plural.py, stage 4
    6. plural.py, stage 5
    7. plural.py, stage 6
    8. Summary
  16. Metaclasses
    1. ...once I figure out WTF metaclasses are...
  17. Performance tuning
    1. Diving in
    2. Using the timeit module
    3. Optimizing regular expressions
    4. Optimizing dictionary lookups
    5. Optimizing list operations
    6. Optimizing string manipulation
    7. Summary
  18. 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
  19. Creating graphics with the Python Imaging Library
    1. ...will likely get ported in time...
  20. Where to go from here (tentative because most of these have not been ported to Python 3 yet)
    1. WSGI
    2. Django
    3. Pylons
    4. TurboGears
    5. AppEngine
    6. IronPython
    7. Jython
    8. PyPy
    9. Stackless Python
  21. 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

Orphans (not sure where these belong yet):

© 2001–4, 2009 ark Pilgrim • open standards • open content • open source