您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

python从sqlite读取并显示数据的方法

2025/8/7 5:11:45发布30次查看
本文实例讲述了python从sqlite读取并显示数据的方法。分享给大家供大家参考。具体实现方法如下:
import cgi, os, sysimport sqlite3 as dbconn = db.connect('test.db')cursor = conn.cursor()conn.row_factory = db.rowcursor.execute(select * from person)rows = cursor.fetchall()sys.stdout.write(content-type: text.html\r\n\r\n)sys.stdout.write()sys.stdout.write()for row in rows: sys.stdout.write(%s %s %s % (row[0],row[1],row[2])) sys.stdout.write(
)sys.stdout.write(
)
希望本文所述对大家的python程序设计有所帮助。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product