can regular ol' python do a php include?

John Salerno johnjsal at NOSPAMgmail.com
Tue Oct 10 13:04:50 EDT 2006


Bruno Desthuilliers wrote:
> John Salerno wrote:
>> Jean-Paul Calderone wrote:
>>
>>> def include(filename):
>>>    print open(filename).read()
>>>
>>> include('header.html')
>>>
>>> Behold, the power of a general purpose programming language.
>>>
>>> Jean-Paul
>> Thanks, pretty good idea! But my guess is that I can't just use it this
>> way within an HTML file.
> 
> As the effbeot kindly mentionned, you cannot do any include in a HTML
> file - the HTML spec doesn't mention such a beast.
> 

Yeah, I just meant including a piece of PHP code in an otherwise HTML 
document (even though the file would be a .php file).



More information about the Python-list mailing list