ยปCore Development>Code coverage>Doc/includes/sqlite3/executemany_2.py

Python code coverage for Doc/includes/sqlite3/executemany_2.py

#countcontent
1n/aimport sqlite3
2n/aimport string
3n/a
4n/adef char_generator():
5n/a for c in string.ascii_lowercase:
6n/a yield (c,)
7n/a
8n/acon = sqlite3.connect(":memory:")
9n/acur = con.cursor()
10n/acur.execute("create table characters(c)")
11n/a
12n/acur.executemany("insert into characters(c) values (?)", char_generator())
13n/a
14n/acur.execute("select c from characters")
15n/aprint(cur.fetchall())