Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 268e1fbf215fb17e1ebed793190457dab6d182cf authored by Ned Deily on 17 June 2017, 08:48:35 UTC
Version bump to 3.6.2rc1
Tip revision: 268e1fb
insert_more_people.py
import sqlite3

con = sqlite3.connect("mydb")

cur = con.cursor()

newPeople = (
    ('Lebed'       , 53),
    ('Zhirinovsky' , 57),
  )

for person in newPeople:
    cur.execute("insert into people (name_last, age) values (?, ?)", person)

# The changes will not be saved unless the transaction is committed explicitly:
con.commit()
back to top