zjm*_*126 0 python arrays google-app-engine
我的代码是:
class demo(BaseRequestHandler):
def get(self):
a=[[1,2,3],[3,6,9]]
self.render_template('map/a.html',{'geo':a})
Run Code Online (Sandbox Code Playgroud)
和HTML是:
{% for i in geo %}
<p><a href="{{ i[0] }}">{{ i[0]}}</a></p>
{% endfor%}
Run Code Online (Sandbox Code Playgroud)
而错误是:
raise TemplateSyntaxError, "Could not parse the remainder: %s" % token[upto:]
TemplateSyntaxError: Could not parse the remainder: [0]
Run Code Online (Sandbox Code Playgroud)
所以我该怎么做 .
谢谢
如果您希望页面显示每个列表的第一项:
{% for i in geo %}
<p><a href="{{ i.0 }}">{{ i.0 }}</a></p>
{% endfor%}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1379 次 |
| 最近记录: |