GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing pythonhosted.org — Cheetah, the Python-Powered Template Engine — Cheetah - The Python-Powered Template Engine Table Of Contents
Next topicThis PageQuick searchEnter search terms or a module, class or function name. Cheetah, the Python-Powered Template Engine¶Introduction¶Cheetah is an open source template engine and code-generation tool written in Python. Cheetah can be used unto itself, or incorporated with other technologies and stacks regardless of whether they’re written in Python or not. At its core, Cheetah is a domain-specific language for markup generation and templating which allows for full integration with existing Python code but also offers extensions to traditional Python syntax to allow for easier text-generation. Talk Cheetah¶You can get involved and talk with Cheetah developers on the Cheetah mailing list ([email protected]) or on the IRC channel: #cheetah on Freenode Contents¶
Cheetah in a nutshell¶Below is a simple example of some Cheetah code, as you can see it’s practically Python. You can import, inherit and define methods just like in a regular Python module, since that’s what your Cheetah templates are compiled to :) #from Cheetah.Template import Template
#extends Template
#set $people = [{'name' : 'Tom', 'mood' : 'Happy'}, {'name' : 'Dick',
'mood' : 'Sad'}, {'name' : 'Harry', 'mood' : 'Hairy'}]
<strong>How are you feeling?</strong>
<ul>
#for $person in $people
<li>
$person['name'] is $person['mood']
</li>
#end for
</ul>
Why Cheetah?¶
Indices and tables¶
© Copyright 2009, R. Tyler Ballance.
Last updated on Nov 16, 2009.
Created using Sphinx 0.6.3.
|
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |