using CGIHTTPserver to test html forms

William D. Gill wmgill at
Mon Feb 23 17:14:16 CET 2004

I'll try it and let you know.



"bblochl" <bblochl at> wrote in message
news:mailman.209.1077551086.27104.python-list at
> William D. Gill schrieb:
> >I use a notebook (win 98) because of its portability.  Unfortunately it
> >very slow.  When I try to develop and test python cgi scripts I use
> >as a local server, but with python, Xitami, and my text editor running it
> >becomes next to impossible to work.  The keyboard and mouse are slowed to
> >painful levels.  Actual execution of the webpage/script is tolerable, but
> >edit I have to stop the server.  I was wondering if using CGIHTTPserver
> >would be a better solution and if anyone can give me an example script
> >(simple enough for a newbie).  Every reference I see to CGIHTTPserver
> >it's good for testing your web forms, but they don't show me how.
> >
> >Thanks
> >
> >Bill
> >
> >
> >
> >
> >
> >
> from BaseHTTPServer import HTTPServer
> from CGIHTTPServer import CGIHTTPRequestHandler
> serveradresse = ("",8080)
> server = HTTPServer(serveradresse, CGIHTTPRequestHandler)
> server.serve_forever()
> I have tried that on Win2k starting in the editor Window of IDle and
> Python will hang. (On other systems it works ok - I have not found the
> reason yet!) On my linux- system I have no problems of that kind. On a
> Windows-network I couldn`t get it to work at all.
> On my test-sytem (Win2k) it works well, if you start it from a
> DOS-Window from the DOS-Prompt by typing
> python
> The html-files must be in the same directory a s the file
> cgi-files must reside in a subdirectory namend cgi-bin.
> To test for instance the html-file name.html, you start the local server
> by typing http://localhost:8080/name.html  (or
> in the browser  adress line.
> Best regards and good luck!
> Bernhard

More information about the Python-list mailing list