mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Move the 3k reST doc tree in place.
This commit is contained in:
parent
739c01d47b
commit
116aa62bf5
423 changed files with 131199 additions and 0 deletions
13
Doc/includes/sqlite3/row_factory.py
Normal file
13
Doc/includes/sqlite3/row_factory.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
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"])
|
Loading…
Add table
Add a link
Reference in a new issue