python in dreamweaver
Josiah Carlson
jcarlson at nospam.uci.edu
Fri Jan 30 17:48:30 EST 2004
Michel Claveau/Hamster wrote:
> Hi !
>
> I prepare "template" pages with DM ; in "strategic" position (where i think
> put infos later), i put a key-word ; then i save the page.
> My web-server (in Python) read the HTML-Page, do multiple search/replace
> (key-words by data), then send the page.
It would be significantly more Pythonic to have a template similar to
the following:
template = '''
<html>
<head>
<title>%(title)s</title>
</head>
<body>
<!-- Insert your HTML mojo here -->
%(menu)s
%(body)s
</body>
</html>
'''
output = template%{'title':"this is the title of the web page",
'menu':"this is the menu",
'body':"this is the body"}
- Josiah
More information about the Python-list
mailing list