Python Templating Language

来自开放百科 - 灰狐
2007年3月1日 (四) 12:27Allen (讨论 | 贡献)的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到: 导航, 搜索

PTL = Python Templating Language

example.ptl:

  1. To callers, templates behave like regular Python functions
def cell [html] (content):
    '<td>'         # Literal expressions are appended to the output
    content        # Expressions are evaluated, too.
    '</td>'
def row [html] (L):
    # L: list of strings containing cell content
    '<tr>'
    for s in L:
分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱