showing results for - "video playing"
Tim
08 Jul 2016
1import sqlite3
2def application(environ, start_response):
3
4 db = sqlite3.connect('/var/www/html/table.db')
5 db.row_factory = sqlite3.Row
6 cursor = db.cursor()
7 cursor.execute('''SELECT id, video_filename FROM table ORDER BY id DESC''')
8 results = ['<table><th>id</th><th>video_filename</th>']
9 for row in cursor:
10  results.append('<tr>')
11  results.append('<td>{0}</td>'.format(row['id']))
12  results.append('<td>{0}</td>'.format(row['video_filename'])
13  results.append('</tr>')
14 db.close()
15 results.append('</table>')
16
17 headers = [
18 ('Content-Type', 'text/html; charset=utf-8'),
19 ('Content-Length', str(sum(len(line) for line in results)))
20 ]
21
22 start_response('200 OK', headers)
23
24 return results
25
similar questions
queries leading to this page
video playing