Fetches all (remaining) rows of a query result, returning a list. Note
that the cursor’s arraysize attribute can affect the performance of
this operation. An empty list is returned when no rows are available.
试试这个:
c = sqlite3.connect('db_path.db')
cur = c.cursor()
cur.execute("SELECT column_name from table_name LIMIT 11")
test = cur.fetchall()
然后,您的html将如下所示:
<table>
{% for row in test %}
<tr>
<th> {{ row[0] }}</th>
</tr>
{% endfor %}
</table>
如果想要查询的所有结果的列表,则应使用^{} ,根据文档:
试试这个:
然后,您的html将如下所示:
相关问题 更多 >
编程相关推荐