手机
当前位置:查字典教程网 >脚本专栏 >python >python查询sqlite数据表的方法
python查询sqlite数据表的方法
摘要:本文实例讲述了python查询sqlite数据表的方法。分享给大家供大家参考。具体实现方法如下:importsqlite3asdbconn=...

本文实例讲述了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条件和循环的使用方法

Python查询Mysql时返回字典结构的代码

python 测试实现方法

python解析模块(ConfigParser)使用方法

python备份文件以及mysql数据库的脚本代码

python处理json数据中的中文

python实现监控linux性能及进程消耗性能的方法

Python获取当前时间的方法

Python操作sqlite3快速、安全插入数据(防注入)的实例

Python生成pdf文件的方法

精品推荐
分类导航