如何解析剩下的:[0]在google-app-engine上

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)

所以我该怎么做 .

谢谢

ber*_*nie 8

如果您希望页面显示每个列表的第一项:

{% for i in geo %}
  <p><a href="{{ i.0 }}">{{ i.0 }}</a></p>
{% endfor%}
Run Code Online (Sandbox Code Playgroud)