PHP + TinyButStrong Python替代品 [英] PHP + TinyButStrong Python replacement

查看:64
本文介绍了PHP + TinyButStrong Python替代品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜!我是一个php用户和一个python程序员。我很乐意使用python来支付我的服务器方需要的b $ b但是我似乎无法找到我正在寻找的东西。对于

大多数我的php工作我使用mysql和tinyButStrong

http://www.tinybutstrong.com )这是一个非常轻量级的模板

引擎,提供强大的功能。你在网上插入TBS标签

页面如:


< div align =" center" class =" title-page" [var.x]< / div>


它将[var.x]替换为全局变量x的值。它还使得b $ b使块(和嵌套块)易于实现:


< p class =" text-example2" [blk1; block = begin ] [blk1.val]< br>

[blk1; block = end]< / p>


在之前的代码中循环数组blk1的值。


它做了很多东西,比如htlm转义,url和js编码等,

条件显示等,但它是将更多的代码插入HTML(又名:乱丢代码和亲吻

告别代码/演示文稿分离)并不会让人感到困惑。它有一个

单个文件的形式,单个类可以很容易地包含在代码中

然后去。


现在,我已经搜索了网络,它似乎充满了基于python的框架

用于服务器端脚本和模板,但没有一个适合我的

需求。


1.我喜欢编写代码,我喜欢控制。我的意思是,打开

最简单的文本编辑器并写入其中。我不想要一些是命令行驱动的或者为我编写代码的东西,比如>>>

makePagesFromThisDatabase()。

2.我想要一些非常轻巧的东西。我不想要十几个选项,

预制博客部分ecc。我只需要一个好的非侵入式模板

引擎和服务器端脚本的基本功能,比如会话

管理,请求解析,操作html代码的功能(编码等)

3.我不想请求我的托管服务提供商安装库。

a简单包含文件应该可以正常工作。

4.不需要面向对象的编程(更好:我更喜欢

普通的旧程序编程)。


任何帮助?提前谢谢

解决方案

5月7日,6:12 * am,pistacchio< pistacc ... @ gmail.comwrote:


嗨!我是一个php用户和一个python程序员。我很乐意使用python来支付我的服务器方需要的b $ b但是我似乎无法找到我正在寻找的东西。对于

大多数我的php工作我使用mysql和tinyButStrong

http://www.tinybutstrong.com )这是一个非常轻量级的模板

引擎,提供强大的功能。你在网上插入TBS标签

页面如:


< div align =" center" class =" title-page" [var.x]< / div>


它将[var.x]替换为全局变量x的值。它还使得b $ b使块(和嵌套块)易于实现:


< p class =" text-example2" [blk1; block = begin ] [blk1.val]< br>

[blk1; block = end]< / p>


在之前的代码中循环数组blk1的值。


它做了很多东西,比如htlm转义,url和js编码等,

条件显示等,但它是将更多的代码插入HTML(又名:乱丢代码和亲吻

告别代码/演示文稿分离)并不会让人感到困惑。它有一个

单个文件的形式,单个类可以很容易地包含在代码中

然后去。


现在,我已经搜索了网络,它似乎充满了基于python的框架

用于服务器端脚本和模板,但没有一个适合我的

需求。


* * 1.我喜欢编写代码,我喜欢控制。我的意思是,打开

最简单的文本编辑器并写入其中。我不想要一些是命令行驱动的或者为我编写代码的东西,比如>>>

makePagesFromThisDatabase()。

* * 2.我想要一些非常轻巧的东西。我不想要十几个选项,

预制博客部分ecc。我只需要一个好的非侵入式模板

引擎和服务器端脚本的基本功能,比如会话

管理,请求解析,操作html代码的功能(编码等)

* * 3.我不想请求我的托管服务提供商安装库。

a简单包含文件应该可以完成工作。

* * 4.不需要面向对象编程(更好:我更喜欢

普通的旧程序编程)。


有什么帮助吗?在此先感谢



你看过TurboGears还是Django? TG使用1.x系列中的Kid

和2.x(我认为)中的Genshi用于模板目的。还有

Cheetah,一个比较强大的Python模板引擎。

http://genshi.edgewall.org/
http://www.kid-templating.org/
http://www.cheetahtemplate.org/
http: //turbogears.org/


也许这些链接可以帮助你。


Mike


Mike Driscoll ha scritto:


5月7日上午6:12,pistacchio< pistacc ... @ gmail.comwrote:


> hi!我是一个php用户和一个python程序员。我很乐意使用python来满足我的服务器需求,但我似乎无法找到我正在寻找的东西。对于
我的大部分php工作我都使用mysql和tinyButStrong
http:// www.tinybutstrong.com )这是一个非常轻量级的模板引擎,提供强大的功能。您在网页
页面中插入TBS标签,例如:

< div align =" center" class =" title-page" [var.x]< / div>

它将[var.x]替换为全局变量x的值。它还使块(和嵌套块)易于实现:

< p class =" text-example2" [blk1; block = begin] [blk1.val]< br>
[blk1; block = end]< / p>

在前面的代码中,它循环遍历数组blk1的所有值。

它做更多的事情,比如htlm转义,url和js编码等,条件显示等等,但是将代码片段插入HTML中也就不那么令人困惑了(又名:乱丢代码和亲吻
告别代码/演示文稿分离)。它以单个文件的形式出现,只有一个类,您可以轻松地将其包含在代码中,然后去。

现在,我已经搜索了网络,它似乎充满了基于python的框架,用于执行服务器端脚本和模板,但没有一个适合我的需求。

1.我喜欢编写代码而我喜欢控制。我的意思是,打开最简单的文本编辑器并写入其中。我不想要一些命令行驱动的东西,或者为我编写代码,如>>>
makePagesFromThisDatabase()。
2.我想要的非常轻巧的东西。我不想要十几个选项,
预先制作的博客部分ecc。我只需要一个好的非侵入式模板引擎和服务器端脚本的基本功能,如会话管理,请求解析,操作HTML代码的功能(编码等)
我不喜欢我想请求我的托管服务提供商安装库。
一个简单的包含文件应该可以工作。
4.不需要面向对象的编程(更好:我更喜欢
程序式编程)。

任何帮助?在此先感谢



感谢重播


您是否看过TurboGears或Django的? TG使用1.x系列中的Kid

和2.x(我认为)中的Genshi用于模板目的。还有

Cheetah,那里比较强大的Python模板引擎之一。



django非常棒的那种巨人我我试图避免

http:// genshi .edgewall.org /



教程的第一行:

"首先,确保你安装了CherryPy 3.0.x" ;

现在,cherrypy是不正确的包含文件并获得


< a rel =nofollowhref =http://www.kid-templating.org/target =_ blank> http://www.kid-templating.org/



孩子似乎有一个非线性的方法,但我可以尝试一下

http://www.cheetahtemplate.org/



猎豹是我已经考虑过的东西。我要

" install"它或者我可以导入它吗?

http:// turbogears .org /



和django一样的问题!


>

也许这些链接可以帮助你。


Mike


pistacchio写道:


Mike Driscoll ha scritto:


> 5月7日上午6:12,pistacchio< pistacc ... @ gmail.comwrote:


>> hi!我是一个php用户和一个python程序员。我很乐意使用python来满足我的服务器需求,但我似乎无法找到我正在寻找的东西。对于
我的大部分php工作我都使用mysql和tinyButStrong
http:// www.tinybutstrong.com )这是一个非常轻量级的模板引擎,提供强大的功能。您在网页
页面中插入TBS标签,例如:

< div align =" center" class =" title-page" [var.x]< / div>

它将[var.x]替换为全局变量x的值。它还使块(和嵌套块)易于实现:

< p class =" text-example2" [blk1; block = begin] [blk1.val]< br>
[blk1; block = end]< / p>

在前面的代码中,它循环遍历数组blk1的所有值。

它做更多的事情,比如htlm转义,url和js编码等,条件显示等等,但是将代码片段插入HTML中也就不那么令人困惑了(又名:乱丢代码和亲吻
告别代码/演示文稿分离)。它以单个文件的形式出现,只有一个类,您可以轻松地将其包含在代码中,然后去。

现在,我已经搜索了网络,它似乎充满了基于python的框架,用于执行服务器端脚本和模板,但没有一个适合我的需求。

1.我喜欢编写代码而我喜欢控制。我的意思是,打开最简单的文本编辑器并写入其中。我不想要一些命令行驱动的东西,或者为我编写代码,如>>>
makePagesFromThisDatabase()。
2.我想要的非常轻巧的东西。我不想要十几个选项,
预先制作的博客部分ecc。我只需要一个良好的非侵入式模板引擎和服务器端脚本的基本功能,如会话管理,请求解析,操作HTML代码的功能(编码
等)
3.我不想请求我的托管服务提供商安装库。
一个简单的包含文件应该可以完成工作。
4.不需要面向对象的编程(更好:我更喜欢
任何帮助?在此先感谢



感谢重播


>你看看了吗? TurboGears还是Django? TG使用1.x系列中的Kid和2.x(我认为)中的Genshi用于模板目的。还有猎豹,这是一个比较强大的Python模板引擎。



django是一种巨人,我正在尝试避免


> http:/ /genshi.edgewall.org/



教程的第一行:

"首先,确保你有CherryPy 3.0。 x安装了

现在,cherrypy是一个不正确的东西包括一个文件并获得



> http:/ /www.kid-templating.org/



孩子似乎有一个非线性方法,但我可以尝试一下


> http://www.cheetahtemplate.org/



猎豹是我已经考虑过的东西。我要

" install"它还是我可以导入它?



您需要安装其中任何一个。它是python如何设计的一部分。

可扩展性带有价格标签。


我不确定,但我猜genshi的樱桃要求是

更多的教程,而不是模板本身。


Diez


hi! i''m a php user and a python programmer. i''d love to use python for
my server side needs but i can''t seem to find what i''m looking for. for
most of my php work i use mysql and tinyButStrong
(http://www.tinybutstrong.com) which is a very lightweight template
engine that offers powerful functionalities. you insert TBS tags in web
pages like:

<div align="center" class="title-page"[var.x] </div>

and it replaces [var.x] with the value of global variable x. it also
makes blocks (and nested blocks) easy to implement:

<p class="text-example2"[blk1;block=begin] [blk1.val]<br>
[blk1;block=end] </p>

in the previous code it cycles throu all the values of the array blk1.

it does many more things, like htlm escaping, url and js encoding etc,
conditional displaying etc, but it is not more confusing that inserting
pieces of code into the HTML (aka: littering the code and kissing
goodbye to the code/presentation separation). it comes in the form of a
single file with a single class that you can easily include in the code
and go.

now, i''ve searched the net and it seems full of python-based frameworks
for doing server side scripting and templating, but none that suits my
needs.

1. i like writing code and i like control. i mean, open up the
simplest text editor and write in it. i don''t want something that is
command-line driven or that writes code for me like ">>>
makePagesFromThisDatabase()".
2. i want something very lightweight. i don''t want dozen of options,
pre-made blogging parts ecc. i just need a good non invasive template
engine and the basic functions for server side scripting, like session
managing, request parsing, functions to manipulate html code (encodings etc)
3. i don''t want to beg my hosting provider to install the libraries.
a simple include file should do the work.
4. object oriented programming is not required (better: i prefer
plain old procedural programming).

any help? thanks in advance

解决方案

On May 7, 6:12*am, pistacchio <pistacc...@gmail.comwrote:

hi! i''m a php user and a python programmer. i''d love to use python for
my server side needs but i can''t seem to find what i''m looking for. for
most of my php work i use mysql and tinyButStrong
(http://www.tinybutstrong.com) which is a very lightweight template
engine that offers powerful functionalities. you insert TBS tags in web
pages like:

<div align="center" class="title-page"[var.x] </div>

and it replaces [var.x] with the value of global variable x. it also
makes blocks (and nested blocks) easy to implement:

<p class="text-example2"[blk1;block=begin] [blk1.val]<br>
[blk1;block=end] </p>

in the previous code it cycles throu all the values of the array blk1.

it does many more things, like htlm escaping, url and js encoding etc,
conditional displaying etc, but it is not more confusing that inserting
pieces of code into the HTML (aka: littering the code and kissing
goodbye to the code/presentation separation). it comes in the form of a
single file with a single class that you can easily include in the code
and go.

now, i''ve searched the net and it seems full of python-based frameworks
for doing server side scripting and templating, but none that suits my
needs.

* * 1. i like writing code and i like control. i mean, open up the
simplest text editor and write in it. i don''t want something that is
command-line driven or that writes code for me like ">>>
makePagesFromThisDatabase()".
* * 2. i want something very lightweight. i don''t want dozen of options,
pre-made blogging parts ecc. i just need a good non invasive template
engine and the basic functions for server side scripting, like session
managing, request parsing, functions to manipulate html code (encodings etc)
* * 3. i don''t want to beg my hosting provider to install the libraries.
a simple include file should do the work.
* * 4. object oriented programming is not required (better: i prefer
plain old procedural programming).

any help? thanks in advance

Did you look at TurboGears or Django? TG uses Kid in the 1.x series
and Genshi in 2.x (I think) for templating purposes. There''s also
Cheetah, one of the more powerful Python templating engines out there.

http://genshi.edgewall.org/
http://www.kid-templating.org/
http://www.cheetahtemplate.org/
http://turbogears.org/

Maybe those links will get you going.

Mike


Mike Driscoll ha scritto:

On May 7, 6:12 am, pistacchio <pistacc...@gmail.comwrote:

>hi! i''m a php user and a python programmer. i''d love to use python for
my server side needs but i can''t seem to find what i''m looking for. for
most of my php work i use mysql and tinyButStrong
(http://www.tinybutstrong.com) which is a very lightweight template
engine that offers powerful functionalities. you insert TBS tags in web
pages like:

<div align="center" class="title-page"[var.x] </div>

and it replaces [var.x] with the value of global variable x. it also
makes blocks (and nested blocks) easy to implement:

<p class="text-example2"[blk1;block=begin] [blk1.val]<br>
[blk1;block=end] </p>

in the previous code it cycles throu all the values of the array blk1.

it does many more things, like htlm escaping, url and js encoding etc,
conditional displaying etc, but it is not more confusing that inserting
pieces of code into the HTML (aka: littering the code and kissing
goodbye to the code/presentation separation). it comes in the form of a
single file with a single class that you can easily include in the code
and go.

now, i''ve searched the net and it seems full of python-based frameworks
for doing server side scripting and templating, but none that suits my
needs.

1. i like writing code and i like control. i mean, open up the
simplest text editor and write in it. i don''t want something that is
command-line driven or that writes code for me like ">>>
makePagesFromThisDatabase()".
2. i want something very lightweight. i don''t want dozen of options,
pre-made blogging parts ecc. i just need a good non invasive template
engine and the basic functions for server side scripting, like session
managing, request parsing, functions to manipulate html code (encodings etc)
3. i don''t want to beg my hosting provider to install the libraries.
a simple include file should do the work.
4. object oriented programming is not required (better: i prefer
plain old procedural programming).

any help? thanks in advance

hi, thanks for replaying

Did you look at TurboGears or Django? TG uses Kid in the 1.x series
and Genshi in 2.x (I think) for templating purposes. There''s also
Cheetah, one of the more powerful Python templating engines out there.

django is exacly the kind of giant i''m trying to avoid

http://genshi.edgewall.org/

the first lines of the tutorial read:
"First, make sure you have CherryPy 3.0.x installed"
Now, cherrypy is something that is not properly "include a file and get
going!"

http://www.kid-templating.org/

kid seems to have a non-linear approach, but i may give it a try

http://www.cheetahtemplate.org/

cheetah was something that i already considered using. have i to
"install" it or can i just import it?

http://turbogears.org/

same problem as with django!

>
Maybe those links will get you going.

Mike


pistacchio wrote:

Mike Driscoll ha scritto:

>On May 7, 6:12 am, pistacchio <pistacc...@gmail.comwrote:

>>hi! i''m a php user and a python programmer. i''d love to use python for
my server side needs but i can''t seem to find what i''m looking for. for
most of my php work i use mysql and tinyButStrong
(http://www.tinybutstrong.com) which is a very lightweight template
engine that offers powerful functionalities. you insert TBS tags in web
pages like:

<div align="center" class="title-page"[var.x] </div>

and it replaces [var.x] with the value of global variable x. it also
makes blocks (and nested blocks) easy to implement:

<p class="text-example2"[blk1;block=begin] [blk1.val]<br>
[blk1;block=end] </p>

in the previous code it cycles throu all the values of the array blk1.

it does many more things, like htlm escaping, url and js encoding etc,
conditional displaying etc, but it is not more confusing that inserting
pieces of code into the HTML (aka: littering the code and kissing
goodbye to the code/presentation separation). it comes in the form of a
single file with a single class that you can easily include in the code
and go.

now, i''ve searched the net and it seems full of python-based frameworks
for doing server side scripting and templating, but none that suits my
needs.

1. i like writing code and i like control. i mean, open up the
simplest text editor and write in it. i don''t want something that is
command-line driven or that writes code for me like ">>>
makePagesFromThisDatabase()".
2. i want something very lightweight. i don''t want dozen of options,
pre-made blogging parts ecc. i just need a good non invasive template
engine and the basic functions for server side scripting, like session
managing, request parsing, functions to manipulate html code (encodings
etc)
3. i don''t want to beg my hosting provider to install the libraries.
a simple include file should do the work.
4. object oriented programming is not required (better: i prefer
plain old procedural programming).

any help? thanks in advance


hi, thanks for replaying

>Did you look at TurboGears or Django? TG uses Kid in the 1.x series
and Genshi in 2.x (I think) for templating purposes. There''s also
Cheetah, one of the more powerful Python templating engines out there.


django is exacly the kind of giant i''m trying to avoid

>http://genshi.edgewall.org/


the first lines of the tutorial read:
"First, make sure you have CherryPy 3.0.x installed"
Now, cherrypy is something that is not properly "include a file and get
going!"

>http://www.kid-templating.org/


kid seems to have a non-linear approach, but i may give it a try

>http://www.cheetahtemplate.org/


cheetah was something that i already considered using. have i to
"install" it or can i just import it?

You will need to install any of these. It is part of how python is designed.
Extendability comes with a price-tag.

I don''t know for sure, but I guess the cherrypy-requirement of genshi is
more for the tutorial, not for the templating itself.

Diez


这篇关于PHP + TinyButStrong Python替代品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆