-------------------------------------------------- test_tmpl1.py -- Pythonでテンプレートを使う(using Cheetah) -------------------------------------------------- #!/usr/local/bin/python from Cheetah.Template import Template template = Template(file='viewpy1.tmpl') template.entry = [{'title': "entry 1", 'description': 'entry 1, blah blah'}, {'title': "entry2", 'description': 'entry 2, blah, blah'}] print temp
![Template-ToolkitのコードをPython(Cheetah)で書き換え | でこぼこ翻訳ハジメ](https://cdn-ak-scissors.b.st-hatena.com/image/square/54eff32cbec67087a89d7c297b7df8ca5afe5c62/height=288;version=1;width=512/https%3A%2F%2Fimage.excite.co.jp%2Fjp%2FappleIcon%2Fapp%2Fblog%2Fapple-touch-icon.png)