没有合适的资源?快使用搜索试试~ 我知道了~
首页python查询sqlite数据表的方法
本文实例讲述了python查询sqlite数据表的方法。分享给大家供大家参考。具体实现方法如下: import sqlite3 as db conn = db.connect('mytest.db') conn.row_factory = db.Row cursor = conn.cursor() cursor.execute("select * from person") rows = cursor.fetchall() for row in rows: print("%s %s %s" % (row["name"], row["age"], row["address"])) conn
资源详情
资源评论
资源推荐

python查询查询sqlite数据表的方法数据表的方法
本文实例讲述了python查询sqlite数据表的方法。分享给大家供大家参考。具体实现方法如下:
import sqlite3 as db
conn = db.connect('mytest.db')
conn.row_factory = db.Row
cursor = conn.cursor()
cursor.execute("select * from person")
rows = cursor.fetchall()
for row in rows:
print("%s %s %s" % (row["name"], row["age"], row["address"]))
conn.close()
希望本文所述对大家的Python程序设计有所帮助。
您可能感兴趣的文章您可能感兴趣的文章:Python获取SQLite查询结果表列名的方法使用Python对SQLite数据库操作Python读取sqlite数据库文件
的方法分析Python SQLite3数据库操作类分享Python操作SQLite数据库的方法详解详解Python 数据库 (sqlite3)应用python 获
取sqlite3数据库的表名和表字段名的实例

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0