Thanks Fredrik for your help. Really short and efficient - very nice! Regards, David
On Monday, November 14, 2005, at 12:12 PM, Fredrik Lundh wrote: > I meant to write > > d = {} > for index, record in enumerate(cursor.fetchall()): > d[index+1] = tuple(record) > > which can be shorted to > > d = dict((k+1, tuple(v)) for k, v in enumerate(x)) > > in recent versions of Python. -- http://mail.python.org/mailman/listinfo/python-list