Coming from Perl

Amer Neely perl4hire at softouch.on.ca
Sat Sep 15 10:18:24 EDT 2007


Bryan Olson wrote:
> Amer Neely wrote:
>> This seems to indicate that maybe my host needs to configure Apache to 
>> run python scripts? But I didn't need to do anything with mine.
> 
> Another possibility: If it works on Windows but not Unix, check
> the end-of-line characters. Windows ends each line with the two
> character sequence carriage-return + newline, which in Python
> is "\r\n". Unix uses newline alone, "\n".
> 
> Most Unixies will choke on a #! line with a carriage return.
> The Python interpreter will accept source files with either
> end-of-line on either system, but of course you'll not get
> that far unless the operating system respects the shebang line.
> 
> Maybe you already checked that. Hmmm...other possiblities...
> 
> Do you have shell access? Can you executing it directly from
> the shell? Do you get a Python error, or some other?
> 
> Did you:  chmod ugo+rx <yourscript>
> 
> Is Python in /usr/bin? What does "which python" say?
> 
> Generally, most experts seem to prefer:
> 
>     #!/usr/bin/env python
> 
> You might try changing the the extension of your script from .py
> to .cgi. Windows uses the .py to choose the executable, but Unix
> does not care; it used the shebang line.
> 
> 

I tried `which python` and `whereis python` and got 0 back as a result. 
So it seems Python is not installed at all.

-- 
Amer Neely
w: www.webmechanic.softouch.on.ca/
Perl | MySQL programming for all data entry forms.
"Others make web sites. We make web sites work!"



More information about the Python-list mailing list