Simon Forman <sajmikins at gmail.com> writes: > Is there a more efficient way to do this? http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/502263