FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Doc/includes/sqlite3/row_factory.py at 3.5 · python-emscripten/cpython · GitHub
python-emscripten
cpython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Doc
/
includes
/
sqlite3
/
row_factory.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (11 loc) · 292 Bytes
Breadcrumbs
cpython
/
Doc
/
includes
/
sqlite3
/
row_factory.py
Copy path
File metadata and controls
13 lines (11 loc) · 292 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
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"
])
Back
|
FazBrowse Home
|
New Git URL