Python Webpages

Ian Bicking ianb at colorstudy.com
Mon Apr 29 21:02:50 EDT 2002


On Mon, 2002-04-29 at 16:41, Johan Fredrik Øhman wrote:
> > I must admit I have never yet seen a system which integrates HTML and
> > code in the same file without the file ending up an unreadable mess.
> 
> I just thought of great idea:  How about using one file and not mix html and
> python code at the same time ?
> Example:
> ==================================================
> <html>
>     <body>
>     %content%
>     </body>
> </html>
> 
> <!--PYTHON Code
> from smartTemplates import *
> 
> page.content =  "Isn't this cool ;)"
> 
> -->
> ==================================================

It's not WYSIWYG compatible, but the easy way to do something like this
is:

"""
<html>
...
<!--
"""

(and then some python code which uses __doc__ and your template system)

#--></body></html>


The first """ is going to be lost by the WYSIWYG editor.  The rest can
be saved...

  Ian







More information about the Python-list mailing list