Python with Apache on WinNT newbie question

Victor Muslin victor at
Thu Dec 28 16:57:22 EST 2000

Thanks. Though my subject mentions NT, I would also like to know how
this is typically addressed on Unix/Linux? Symbolic links?

On Thu, 28 Dec 2000 20:21:34 +0100, gerhard.nospam at (Gerhard
=?iso-8859-1?Q?H=E4ring?=) wrote:

>I recommend to add the following line to httpd.conf under WinNT:
>ScriptInterpreterSource Registry
>and give your Python scripts the extension ".py". A Python CGI script can
>then look like:
>#!/usr/bin/env python
>print 'Content-type: text/plain\n\nHello!'
>and work perfectly under WinNT and Linux!
>Gerhard Häring
>mail:   gerhard <at> bigfoot <dot> de
>On Thu, 28 Dec 2000 16:07:07 GMT, Victor Muslin <victor at> 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