python and www

Tino Wildenhain tino at wildenhain.de
Mon Jan 24 04:14:17 EST 2000


--On Sonntag, 23. Januar 2000 08:56 -0800 Sameer Chowdhury 
<sameerc1 at yahoo.com> wrote:

>
> I want to invoke the python interpreter, pass it my script, and direct
> the script's output as a response to a request made by a client browser.
> Without using Python with ASP, does anyone know how I would go about
> doing that (say using IIS or Apache).  Thanks in advance.
>

all you need is usual:

#!/path/to/python/executable/python

at the top of the file.
(please dont type it literaly ;)

This works for Apache on Unix (naturally)
and as well on Windows.
(with Windows you need the drive-letter c: or something
at the start)

If the script resides in /cgi-bin/script.py
you need only refer to the script. The python
interpreter will be located automatically.
(note: witrh unix you must also set the flags
on the file for "executable")

hth
Tino Wildenhain






More information about the Python-list mailing list