Re: python in dreamweaver

From: Josiah Carlson (jcarlson_at_nospam.uci.edu)
Date: 01/30/04


Date: Fri, 30 Jan 2004 14:48:30 -0800

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



Relevant Pages

  • Re: help include
    ... You can browse to home.php and see your template. ... <?php include; ?> ...
    (comp.lang.php)
  • Modify default HTML template
    ... I'm going to start using Frontpage to organize my site ... I don't like the default HTML that Frontpage creates when ... my template: ...
    (microsoft.public.frontpage.programming)
  • Re: Servlet cache issue
    ... yes it's tomcat, there are no jsp's ... the template is ...
    (comp.lang.java.programmer)
  • Re: is anyone here going to help me??? does anyone here know anything at all???
    ... I am very sure that if I post my broken template and they ... Until like three or four days ago, everything on my blog displayed ... The generic Google ad beneath the blog title box displayed perfectly. ... I tried to publish and got a broken HTML error. ...
    (rec.gambling.poker)
  • Re: is anyone here going to help me??? does anyone here know anything at all???
    ... I am very sure that if I post my broken template and they ... Until like three or four days ago, everything on my blog displayed ... The Google ads for Ad Sense, etc., in the right sidebar displayed perfectly. ... I tried to publish and got a broken HTML error. ...
    (rec.gambling.poker)