手机
当前位置:查字典教程网 >脚本专栏 >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 字符串split的用法分享

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

wxpython中利用线程防止假死的实现方法

python mysqldb连接数据库

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

Python获取当前时间的方法

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

python实现排序算法

Python中使用中文的方法

精品推荐
分类导航