views:

71

answers:

1

If I want to insert the output of a script into an HTML file using server side includes, is it better to use

<!--#include virtual="/cgi-bin/myscript.py" -->

or

<!--#exec cmd="python /cgi-bin/myscript.py" -->

?

+1  A: 

A small advantage to the #include format is that, should you change the location or name of your python executable, you only need to change the configuration once in your Apache config, rather than having to change every SSI call on your site.

Both of these forms, however, will start up and tear down a new python binary every time the script is called, which is a decently big hit. This is why something like mod_python is almost always preferred.

Conspicuous Compiler
Thank you for introducing me to mod_python.
Charles Anderson