import sqlite3
persons=[
("Jim","Green"),
("Hu","jie")
]
conn=sqlite3.connect(":memory:")
conn.execute("CREATE TABLE person(firstname,lastname)")
conn.executemany("INSERT INTO person(firstname,lastname) VALUES(?,?)",persons)
for row in conn.execute("SELECT firstname,lastname FROM person"):
print(row)
print("I just deleted",conn.execute("DELETE FROM person").rowcount,"rows") y ========
('Jim', 'Green')
('Hu', 'jie')
I just deleted 2 rows 以上就是python中关于executemany以及序列的实例详解的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于python中关于executemany以及序列的实例详解的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did84594