You might want to have a look at this sample chapter from the new "Python Standard Library" book: http://www.oreilly.com/catalog/pythonsl/chapter/ch05.html