【发布时间】:2017-01-08 04:11:53
【问题描述】:
我使用bottle在html模板中打印一些json,所以我在模板中这样做:
% for rows in url:
<ul>
% for cols in rows[0:2]:
<li>
{{cols}}
</li>
% end
% for req in rows[2:3]:
<li>
{{req}}
</li>
% end
</ul>
% end
结果:
- http://www.adress/
- 1.5
- {'x-xss-保护': '1;模式=块','x-content-type-options': 'nosniff', 'age': '2295260', 'expires': 'Fri, 08 Dec 2017 08:32:02 GMT', 'vary': 'Accept-Encoding', 'server': 'sffe', 'last-modified': '星期四,2016 年 12 月 8 日 01:00:57 GMT','连接':'关闭'}
但我想在列表的最后一项中创建另一个列表, 所以如果我这样做了
% for list in req:
{{list}}
% end
我明白了
- x
- -
- x
- s
- s
- ...
有没有人想打印这份清单?
【问题讨论】: