FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Doc/includes/sqlite3/shortcut_methods.py at master · 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
/
shortcut_methods.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (17 loc) · 611 Bytes
Breadcrumbs
cpython
/
Doc
/
includes
/
sqlite3
/
shortcut_methods.py
Copy path
File metadata and controls
24 lines (17 loc) · 611 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
14
15
16
17
18
19
20
21
22
23
24
import
sqlite3
persons
=
[
(
"Hugo"
,
"Boss"
),
(
"Calvin"
,
"Klein"
)
]
con
=
sqlite3
.
connect
(
":memory:"
)
# Create the table
con
.
execute
(
"create table person(firstname, lastname)"
)
# Fill the table
con
.
executemany
(
"insert into person(firstname, lastname) values (?, ?)"
,
persons
)
# Print the table contents
for
row
in
con
.
execute
(
"select firstname, lastname from person"
):
print
(
row
)
print
(
"I just deleted"
,
con
.
execute
(
"delete from person"
).
rowcount
,
"rows"
)
# close is not a shortcut method and it's not called automatically,
# so the connection object should be closed manually
con
.
close
()
Back
|
FazBrowse Home
|
New Git URL