embedding/parsing script

Stephan Diehl stephan.diehl at gmx.net
Mon Dec 9 11:44:22 EST 2002


Gumuz wrote:

> Hi all,
> 
> I would like to integrate some kind of scripting capability into my python
> app. See it like this: i have a text document where i want to embed some
> simple script between 'tags'. for example i have 'folder-objects' which
> can contain folders and 'page-objects'. a page object has a headline and a
> textcontent property. i imagine it something like this:
> 
> -------------------------
> welcome,
> this is my page, this is the content of this page.
> 
> these are the pages in folder ###:
> <pyScript>
> for X in FolderID:
>   print X.HeadLine
> </pyScript>
> 
> end of file
> ---------------------------
> 
> How would one go about doing this. I don't want to give my users the full
> power of python, because then they could stop the app or delete objects
> etc. I want to give them limited scripting capability with a python-like
> syntax.
> 
> all suggestions are welcome as i have absolutely no clue hoe to begin
> something like this.

You should go for cheetah (cheetahtemplate.org), as this gives you exactly 
what you want: text with embedded scipts.

Stephan



More information about the Python-list mailing list