can regular ol' python do a php include?

Bruno Desthuilliers onurb at xiludom.gro
Tue Oct 10 12:01:32 EDT 2006


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.

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list