Bruce Eckel example / CGI server for localhost for Windows XP possible?

Will Stuyvesant hwlgw at hotmail.com
Fri Jan 9 14:07:17 CET 2004


Bruce Eckel has a good article about using a browser as UI for
applications you write:

http://mindview.net/WebLog/log-0045

His example code is nice, he sets up a webserver *and is able to kill
it too via a HTML button*.  But his webserver does not do CGI.  I have
been trying to change the code with CGIHTTPRequestHandler and other
such things, I have also tried various "recipes" for CGI webservers,
but I can not get something that works well enough.  Could well be
that my poor programming skill is to blame here.  Especially handling
POST is important (if a user inputs a file via HTML <input type="file"
/> then you don't want the whole file in the URL location bar.  I have
a version that handles the first POST but crashes on subsequent POSTs.
 So now I just use the Apache CGi webserver, but this means that if I
want to give somebody else my CGI program they also have to install
Apache.

Is there anybody who can provide simple example code like found in
Fredrik Lundh's Python Standard Library book for setting up a CGI
server for localhost with Python?  Perhaps the examples that are
available work on linux, but not on my Windows XP laptop with Python
2.3.3: GET works and the first POST works too, subsequent POSTs crash.



More information about the Python-list mailing list