diff options
| author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2022-08-31 05:54:54 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-31 05:54:54 (GMT) |
| commit | f7e7bf161aaec5a5cffdcec7c97e1f09e445421b (patch) | |
| tree | e9d339cca5899de4dd2fed407baad75af2631d96 /Doc/includes/sqlite3/execute_1.py | |
| parent | 8ba22b90cafdf83d26318905a021311c6932d2c0 (diff) | |
| download | cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.zip cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.gz cpython-f7e7bf161aaec5a5cffdcec7c97e1f09e445421b.tar.bz2 | |
gh-96414: Inline code examples in sqlite3 docs (#96442)
Diffstat (limited to 'Doc/includes/sqlite3/execute_1.py')
| -rw-r--r-- | Doc/includes/sqlite3/execute_1.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/Doc/includes/sqlite3/execute_1.py b/Doc/includes/sqlite3/execute_1.py deleted file mode 100644 index ee0000e..0000000 --- a/Doc/includes/sqlite3/execute_1.py +++ /dev/null @@ -1,22 +0,0 @@ -import sqlite3 - -con = sqlite3.connect(":memory:") -cur = con.cursor() -cur.execute("create table lang (name, first_appeared)") - -# This is the qmark style: -cur.execute("insert into lang values (?, ?)", ("C", 1972)) - -# The qmark style used with executemany(): -lang_list = [ - ("Fortran", 1957), - ("Python", 1991), - ("Go", 2009), -] -cur.executemany("insert into lang values (?, ?)", lang_list) - -# And this is the named style: -cur.execute("select * from lang where first_appeared=:year", {"year": 1972}) -print(cur.fetchall()) - -con.close() |
