python中Mako库怎么用?

361次阅读
没有评论
python中Mako库怎么用?

Mako的优点:

学习成本低,能够在结构上进行转义。

应用方向:

文本文件生成。

模块引用:

from mako.template import Template

基本用法:

from mako.template import Template
t = Template('hello world!')
print t.render()

这里给大家调用的是Template 类,与Mako库的搭配,可以创建模板,这也是最基础的应用,好啦,本章内容到此结束,希望可以帮助大家学习。

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-05-10发表,共计228字。
新手QQ群:570568346,欢迎进群讨论 Python51学习