Python code coverage for Doc/includes/sqlite3/executemany_2.py
# | count | content |
---|---|---|
1 | n/a | import sqlite3 |
2 | n/a | import string |
3 | n/a | |
4 | n/a | def char_generator(): |
5 | n/a | for c in string.ascii_lowercase: |
6 | n/a | yield (c,) |
7 | n/a | |
8 | n/a | con = sqlite3.connect(":memory:") |
9 | n/a | cur = con.cursor() |
10 | n/a | cur.execute("create table characters(c)") |
11 | n/a | |
12 | n/a | cur.executemany("insert into characters(c) values (?)", char_generator()) |
13 | n/a | |
14 | n/a | cur.execute("select c from characters") |
15 | n/a | print(cur.fetchall()) |