RecordSet (ADO) with stored procs
Syver Enstad
syver at osiris.no
Fri Nov 8 04:32:51 EST 2002
tim.golden at viacom-outdoor.co.uk (Tim Golden) writes:
> [...] snip very useful ADO db module [...]
>
> Looks great, Syver. Could I just ask, tho', where does one get hold of
> the utilities module on line 5?
>
> > from utilities import Indexed
Ouch! sorry about that.
>
> Or, alternatively, what's the definition of the Indexed function it
> exposes?
It's stolen from the Python cookbook on ActiveState's site.
def Indexed(sequence):
""" Paralell looping on sequence item and index
stolen from Alex Martelli Python Cookbook
Usage:
for item, index in Indexed(sequence):
doStuff(item, index)
"""
class Index:
def __getitem__(self, i):
return i
return zip(sequence, Index())
More information about the Python-list
mailing list