can regular ol' python do a php include?

John Salerno johnjsal at NOSPAMgmail.com
Tue Oct 10 11:29:48 EDT 2006


John Salerno wrote:

> print open('header.html').read()
> 
> Not quite as elegant as include('header.html'), but it seems like it 
> would work.

Spoke too soon maybe. Does using the above mean that I have to create an 
entire Python file rather than an HTML file? What I'm looking for is to 
be able to use pure HTML, but just stick in a line of Python when I need 
to include something.

It doesn't seem to work this way though, unless I'm doing something wrong.



More information about the Python-list mailing list