[Tutor] python from shell
Lloyd Kvam
pythontutor@venix.com
Tue, 09 Jul 2002 10:57:25 -0400
#!/usr/bin/env python
finds python using your environment. A cgi script is running in the
httpd server's environment wich may not support finding python. It is
quite common for cgi scripts to point directly to python.
SA wrote:
> On 7/9/02 7:37 AM, "Scot W. Stevenson" <scot@possum.in-berlin.de> wrote:
>
>
>>Hello Guillermo,
>>
>>
>>>You have to add #! and the path of your python command in the first line
>>>of your code. In my case is:
>>>#! /usr/bin/python
>>>
>>I've been using
>>
>>#!/usr/bin/env python
>>
>>instead with no ill effects so far - which, if I understand correctly,
>>gives the program the environment variables, too.
>>
>>Y, Scot
>>
> The only problem I've seen with this so far is when I write a cgi script.
> For some reason /usr/bin/env chokes my Apache server and spews an error. In
> a regular python script, this works fine for me. I just changed that line to
> the direct route to python for my cgi scripts.
>
> Good Luck.
> SA
>
>
>
--
Lloyd Kvam
Venix Corp.
1 Court Street, Suite 378
Lebanon, NH 03766-1358
voice:
603-443-6155
fax:
801-459-9582