mirror of
https://github.com/python/cpython.git
synced 2025-11-03 07:01:21 +00:00
(cherry picked from commit 92d1064727)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
18 lines
339 B
Python
18 lines
339 B
Python
import sqlite3
|
|
|
|
con = sqlite3.connect("mydb")
|
|
|
|
cur = con.cursor()
|
|
|
|
languages = (
|
|
("Smalltalk", 1972),
|
|
("Swift", 2014),
|
|
)
|
|
|
|
for lang in languages:
|
|
cur.execute("insert into lang (name, first_appeared) values (?, ?)", lang)
|
|
|
|
# The changes will not be saved unless the transaction is committed explicitly:
|
|
con.commit()
|
|
|
|
con.close()
|