Made the example pythonic

the original module had a lot of bad practices in it.  this is the more idiomatic, and frankly, less fragile, method of doing things.