|
|
第2行: |
第2行: |
| | | |
| http://www.cherrypy.org/ | | http://www.cherrypy.org/ |
− |
| |
− | #apt-get install python2.4-cheetah
| |
− | cheetah test
| |
− |
| |
− | >>> from Cheetah.Template import Template
| |
− | >>> templateDef = """
| |
− | ... <HTML>
| |
− | ... <HEAD><TITLE>$title</TITLE></HEAD>
| |
− | ... <BODY>
| |
− | ... $contents
| |
− | ... ## this is a single-line Cheetah comment and won't appear in the output
| |
− | ... #* This is a multi-line comment and won't appear in the output
| |
− | ... blah, blah, blah
| |
− | ... *#
| |
− | ... </BODY>
| |
− | ... </HTML>"""
| |
− | >>> nameSpace = {'title': 'Hello World Example', 'contents': 'Hello World!'}
| |
− | >>> t = Template(templateDef, searchList=[nameSpace])
| |
− | >>> print t
| |
− | ==User==
| |
− | *http://reddit.com/
| |
− | *http://klive.cpushare.com/ - KLive: Linux Kernel Live Usage Monitor
| |
− | *[[Snurf Python-based Blog|Snurf]]
| |
− | *[[PyBlosxom]]
| |
− | *http://linuxgazette.net/
| |
2007年3月6日 (二) 00:26的版本
CherryPy is a pythonic, object-oriented HTTP framework.
http://www.cherrypy.org/