Includeing Python in text files

Chris Smith mc_anjo at tamu.edu
Mon May 22 23:48:41 EDT 2006


Diez B. Roggisch wrote:
> Paolo Pantaleo wrote:
> 
> 
>>I am working on this:
>>
>>I have  a text file, containig certain section in the form
>><?py
>>  python code here
>>py?>
>>
>>I parse the text file and substitute the python code with its result
>>[redirecting sys.stdin to a StringIO]. It something like php or
>>embedded perl.
>>
>>So my little toy works not bad, but I was wondering if such a feature
>>already existed, if yes, can you point me out some links?
> 
> 
> Its a templating system, and there are a gazillion out there. Some of them
> are listed here:
> 
> http://www.cherrypy.org/wiki/ChoosingATemplatingLanguage
> 
> 
> Diez
> 
> 
> 
I'm just getting into programming so this may be a dumb question...but 
why would you want to do this? What is templating good for?

Chris




More information about the Python-list mailing list