SV: Function to convert fetchone() result from a list to a dictionary

Carsten Gehling carsten at gehling.dk
Tue Apr 29 07:43:32 EDT 2003


> Fra: python-list-admin at python.org
> [mailto:python-list-admin at python.org]Pa vegne af Neil Padgen
> Sendt: 29. april 2003 11:16

> Take a look at the cursorclass argument:

<snip>

> >>> c = db.cursor(cursorclass=MySQLdb.cursors.DictCursor)

<snip>

Hmm... Nice. However, is this MySQLdb.cursors.DictCursor available in other
DB modules - say, if I someday changed to (shudder) Postgres or Oracle?

- Carsten








More information about the Python-list mailing list