View Single Post
Old Jan 28th, 2008, 12:11 AM   #9
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,799
Rep Power: 5 Sane will become famous soon enough
Re: Running python scripts on localhost

Quote:
Originally Posted by Swan View Post
Why the browser is not able to detect the code and run it.

It has nothing to do with your browser. It has to do with a webserver which supports CGI capabilities with Python.

First, make sure you have a webserver which is operational. This can be verified by visiting localhost and making sure you can see any files placed in the document root.

Then, make sure you have Python installed.

The first thing your script should do is point to the location of the Python interpeter (see the code I posted in the first reply).

Finally, assert that you've configured your webserver to have CGI-support enabled for .py extentions. This process will vary depending on what webserver software you're using. It is well documented for Apache.
Sane is offline   Reply With Quote