Contents
Idiomatic Python
Some simple info varieties
Listing comprehensions
Creating your personal kinds
Iterators
Generators
assert
Conclusions Structuring,
Microsoft Office Pro 2007, Testing,
Microsoft Office Pro 2007, and Preserving Python Programs
Programming for reusability
Modules and scripts
Deals
A brief digression: naming and formatting
Yet another quick digression: docstrings
Sharing info in between code
Scoping: a digression
Back again to sharing information
How modules are loaded (and when code is executed)
PYTHONPATH, and locating offers & modules during development
setup.py and distutils: the old fashioned way of installing Python offers
setup.py,
Office Standard, eggs, and easy_install: the new fangled way of installing Python offers Testing Your Software
An introduction to testing concepts
The doctest module
Unit tests with unittest
Testing with nose
Code coverage analysis
Adding tests to an existing project
Concluding thoughts on automated testing An Extended Introduction to the nose Unit Testing Framework
What are unit tests?
Why use a framework? (and why nose?)
A few simple examples
Test fixtures
Examples are included,
Office 2010 Professional Plus! A somewhat more complete guide to test discovery and execution
Running tests
Debugging test discovery The nose command line
-w: Specifying the working directory
-s: Not capturing stdout
-v: Info and debugging output
Specifying a record of tests to run Running doctests in nose
The 'attrib' plug-in -- selectively running subsets of tests
Running nose programmatically
Writing plug-ins -- a simple guide
nose caveats -- let the buyer beware, occasionally
Credits Idiomatic Python revisited
sets
any and all
Exceptions and exception hierarchies
Function Decorators
try/finally
Function arguments,
Office Pro Plus, and wrapping functions Measuring and Increasing Performance
Which profiler should you use?
Measuring code snippets with timeit Speeding Up Python
psyco
Installing psyco
Using psyco pyrex Tools to Help You Work
IPython
screen and VNC
Trac Online Resources for Python
Wrapping C/C++ for Python
Manual wrapping
Wrapping Python code with SWIG
Wrapping C code with pyrex
ctypes
SIP
Boost.Python
Recommendations
One or two more notes on wrapping Offers for Multiprocessing
threading
Writing (and indicating) threadsafe C extensions
parallelpython
Rpyc
pyMPI
multitask Useful Packages
subprocess
rpy
matplotlib Idiomatic Python Take 3: new-style classes
Managed attributes
Descriptors GUI Gossip
Python 3.0