Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有可能向这个函数发送一个列表或一个像参数一样的元组:
self.response.out.write(template.render(self.path, sentList))
我是新手,听说您只能发送字典。这是真的吗?
您只能传递一个字典,但该字典中的项目可以是列表:
self.response.out.write(template.render(self.path, {'numbers': [1,2,3,4,5,6]}))
然后您可以在您的模板中访问{{ numbers}}它,并使用
{{ numbers}}
{% for number in numbers%}{{ number}}{% endfor %}