Python code coverage for Doc/includes/sqlite3/insert_more_people.py
# | count | content |
---|---|---|
1 | n/a | import sqlite3 |
2 | n/a | |
3 | n/a | con = sqlite3.connect("mydb") |
4 | n/a | |
5 | n/a | cur = con.cursor() |
6 | n/a | |
7 | n/a | newPeople = ( |
8 | n/a | ('Lebed' , 53), |
9 | n/a | ('Zhirinovsky' , 57), |
10 | n/a | ) |
11 | n/a | |
12 | n/a | for person in newPeople: |
13 | n/a | cur.execute("insert into people (name_last, age) values (?, ?)", person) |
14 | n/a | |
15 | n/a | # The changes will not be saved unless the transaction is committed explicitly: |
16 | n/a | con.commit() |