极其简洁的文本文件模板引擎
项目描述
一个小型模板引擎,通过字典值替换变量
cat file.txt "This is a {{variable}} in a {{string}}" from coima import Template t = Template({'variable':'word', 'string':'sentence'}, 'file.txt') t.render() u"This is a word in a sentence"
语法
不允许Python或代码块,这是一个基本的模板引擎。
变量应为一个单词或由下划线连接的两个单词。这些是有效变量
{{variable}} {{variable_one}}
无效变量将被保留原样,并留在最终的渲染模板中。
关闭
coima-0.0.2.tar.gz的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | aae5fa1a5bd4ae07073779ea362851b6c1a703536b59b8ac0f75a9ed1f4e49ca |
|
MD5 | 176436b6b5675192ea88ff4774d7aff0 |
|
BLAKE2b-256 | 6c2cb15baa38afb76d24fa3b370ac06046ed21e5e71139b2ffe81092d8c4e4f1 |