David Pratt wrote:
> With the tip, I
> simplified my code to:
>
> vlist_dict = {}
> record_count = 0
> for record in cursor.fetchall():
>       record_count += 1
>       vlist_dict[record_count] = tuple(record)
> print vlist_dict

I missed your original post, so forgive me if I'm missing the point
here. But if you're indexing the dictionary with integers, I expect you
could just use a list instead, which I think could make your code look
like this:

vlist = [tuple(record) for record in cursor.fetchall() ]
print vlist

In Python there is rarely any need to manually increment index values
within a loop. If you do need the record count here, len(vlist) would
be equivalent.

-- 
Ben Sizer

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to