Python with Apache on WinNT newbie question

Jeff Bauer jbauer at rubic.com
Fri Dec 29 15:58:40 CET 2000


Victor,

Here's a trick I once used to maintain compatibility between
Windows/Unix CGI scripts. Create a C:\usr\local\bin directory
and copy the C:\Python\python.exe file into it. 

Then use the following header line on your portable CGI scripts:

            #!/usr/local/bin/python

I haven't tried this kludge recently, but I think it should
still work.

Jeff Bauer
Rubicon


Victor Muslin wrote:
> 
> To get Apache server to run a Python CGI script, the script needs to
> have on its first line a directive telling Apache the file name of the
> Python interpreter, like so:
> 
>         #!d:/apps/python/python.exe
>         #
>         # The rest of my cgi script follows
>         # ....
> 
> The problem with this is deploying this script on different machines
> that may have Python interpreter installed in different directories.
> Surely others had run into the same issue. What is a typical solution?
> Unfortunately, if this directive can take environmental variables I
> could not figure out how to do it.




More information about the Python-list mailing list