[Tutor] Python equiv to PHP "include" ?

Adam Cripps kabads at gmail.com
Thu Sep 29 16:49:59 CEST 2005

On 9/29/05, Jay Loden <python at jayloden.com> wrote:
> I've not been able to find an answer to this conundrum anywhere:
> My current website is done in PHP with a setup something like this:
> include('file.htm')
> This way, I can have PHP embedded in my htm files and it will be processed as
> part of the script. For example, I can have a form that's written in HTML and
> processed in PHP, then simply 'include("form.htm")' and I have a form with
> processing that's ALSO wrapped in my site template.
> I can't figure out how one would approach this in Python (i'm using
> mod_python). There's no equivalent to the "include" function from PHP. I
> can't use import because then Python would try to parse the HTML from the
> imported file.

I thought PHP also parsed any html rendered through an included file?
Am I wrong here?
PGP key: 0x7111B833

More information about the Tutor mailing list