PHP + TinyButStrong Python replacement

pistacchio pistacchio at gmail.com
Wed May 7 07:12:49 EDT 2008


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



More information about the Python-list mailing list