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://www.haodehen.cn/did84580