Note - there are a couple of *minor* chanegs to this. See the online python cookbok, the thread on comp.lang.python or http://www.voidspace.org.uk/python/weblog/index.shtml