Excuting scripts question

Peter Hansen peter at engcorp.com
Sun Jun 8 02:57:55 CEST 2003


Ken wrote:
> 
> > > Hi, I have a few scripts that ran well in Unix environment with:
> > > #!/usr/local/bin/python
> > >
> > > What do I need to change to if I relocate these scripts on a Windows
> > > environment? I have installed Python 2.2.3 in C:\Python22 directory.
> >
> Hi, I tried to run the script on IE (eg: http://192.168.0.2/test1.cgi) but
> it doesn't seem to load. (The script seems to load forever... but ordinary
> html files work)

And 192.168.0.2 is your own machine?  Do you have a web server 
running on it?  IE does not actually execute CGI or Python or
anything except *client-side* Javascript and Java.  If you want
to execute CGI, you have to have a web server running, and the
web server itself executes the CGI and returns its results to
IE in the form of HTML.

IE can handle HTML that is loaded from the local filesystem, but
consider this to be a special feature, not something that means
you can treat your hard drive exactly as you treat a web server.

If you want to learn more, try looking at CGIHTTPServer in the 
standard library, or look into setting up another web server 
locally, perhaps ... Twisted.  :-)

-Peter




More information about the Python-list mailing list