0
在pystache(或大多数模板库),你可以做一个替代像这样:pystache - 返回所有模板字符串
>>> print pystache.render('{{person}} in {{place}}', {'person': 'Mom', 'place': 'Spain'})
Mom in Spain
是否有可能做“”相反?即用一个字符串中的所有模板返回一个字典(或更正确地说,一个集合)?
>>> templates = pystache.get_templates('{{person}} in {{place}}')
>>> print templates
{'person', 'place'}
谢谢。
感谢。我最终做了类似的事情。希望直接在pystache中做到这一点。可以将它作为问题/请求提交。 – smg