diff options
Diffstat (limited to 'Doc/lib/sqlite3/row_factory.py')
-rw-r--r-- | Doc/lib/sqlite3/row_factory.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/Doc/lib/sqlite3/row_factory.py b/Doc/lib/sqlite3/row_factory.py deleted file mode 100644 index 64676c8..0000000 --- a/Doc/lib/sqlite3/row_factory.py +++ /dev/null @@ -1,13 +0,0 @@ -import sqlite3 - -def dict_factory(cursor, row): - d = {} - for idx, col in enumerate(cursor.description): - d[col[0]] = row[idx] - return d - -con = sqlite3.connect(":memory:") -con.row_factory = dict_factory -cur = con.cursor() -cur.execute("select 1 as a") -print cur.fetchone()["a"] |