您好,欢迎访问一九零五行业门户网

解析python中executemany和序列用法教程

这篇文章主要介绍了详解python中executemany和序列的使用方法的相关资料,需要的朋友可以参考下
详解python中executemany和序列的使用方法
一 代码
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和序列用法教程的详细内容。
其它类似信息

推荐信息