手机
当前位置:查字典教程网 >脚本专栏 >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处理json数据中的中文

Python生成pdf文件的方法

python处理文本文件实现生成指定格式文件的方法

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

Python中针对函数处理的特殊方法

python 字符串split的用法分享

python del()函数用法

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

Python获取当前时间的方法

python实现问号表达式(?)的方法

精品推荐
分类导航