python in dreamweaver

B

Ben

Hi all,

Is it possible to design my web site in Dreamweaver and add python
codes in it later??

Thanx
Ben
 
M

Michel Claveau/Hamster

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.


* sorry for my bad english *


Michel Claveau
 
J

Josiah Carlson

Michel said:
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
 
M

Michel Claveau/Hamster

Hi !

the following...

Yes, but there are the visual aspect of DM...


MCI
 
J

Josiah Carlson

It would be significantly more Pythonic to have a template similar to
the following...

Yes, but there are the visual aspect of DM...


MCI

So do your templates in Dreamweaver, and read them in with python during
runtime. All I'm saying is that:

is not pythonic, but using standard python string formatting options:

is not only pythonic, it is faster for large numbers of insertions, and
is much easier to extend.

- Josiah
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,176
Messages
2,570,947
Members
47,501
Latest member
Ledmyplace

Latest Threads

Top