您好,欢迎访问一九零五行业门户网

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

本文实例讲述了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程序设计有所帮助。
其它类似信息

推荐信息