开发者

Python web.py template, how to escape (.) dot

In web.py template: index.html I wrote:

$def with(s)
<img 开发者_JAVA技巧src="$s.filename.png" />

s.filename's value is "picuture" so I want to print

<img src="picture.png" />

but how can I tell web.py templating system do not to use $s.filename.png just use $s.filename and add ".png" to it?


See the Templetor docs:

Expression can be enclosed in () or {} for explicit grouping.

So, in your case,

<img src="${s.filename}.png" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜