A Simple Python Web-Server for Windows and Mac/Unix

Download, Installation and Check

Downloading: 

Create a directory somewhere, and call it PythonWebServer. Then download the appropriate Python-based web server from correct link below and unzip it into the new directory.  

When unzipping, be sure to allow the creation of new directories.  When done, you should have 2 new directories beneath PythonWebServer called html-stuff and cgi-bin with some files already in each of them.  If that's not the case, redo the unzipping to fix that.

In the future: put your .html files (those that do not involve any Python programs) into the html-stuff directory and the python programs that the web server should execute into the cgi-bin directory.  However, if there are data files that your Python program opens, put them into the main directory (the one that the PythonWebServer.py file is in), but don't use add any "path" to the filename when using the "open(filename,'r')" command even though the data file is in a different directory than the program file.

Running the Web Server: 

Find the PythonWebServer directory (using a file manager), and double-click on the file: PythonWebServer.py.  A black window should come up, with the words: "Started CGI Server..."  If that doesn't happen, then for some reason,  Windows can't execute your python programs automatically.  Try to fix that, if you can.  Or get into IDLE, and open the PythonWebServer.py file, and run it.

Check:

In your browser (e.g. Firefox, Chrome, Safari, etc), go to the following web page: "http://localhost:9000".  You should see a web page that will step you through some tests.  If you don't, then there's trouble in webserverland.

Shutdown the Web Server:

On Windows: In the black window (or in IDLE) where you started the web server, there should be a record of all of the pages it served.  Press Ctrl-C (^C).  That should shut down the server.
On Mac/Unix: if you started the server in IDLE, close IDLE -- there may be a problem with shutting the server down using the normal ^C.