【发布时间】:2015-04-07 12:45:11
【问题描述】:
这是我的代码。我想在网上展示这些价值观。怎么办?
import sqlite3
def application(environ, start_response):
db = sqlite3.connect('/root/example.db')
db.row_factory = sqlite3.Row
cursor = db.cursor()
cursor.execute('''SELECT id, message,date FROM table''')
for row in cursor:
print('{0} : {1}, {2}'.format(row['id'], row['message'], row['date']))
db.close()
start_response('200 OK', [('Content-Type', 'text/html; charset=utf-8')])
【问题讨论】:
-
@hakkikonu:OP 正在使用原始 WSGI。您可以通过解释为什么要链接到其他框架来使您的 cmets 更具建设性,但仅仅转储链接是没有帮助的。