Standalone CGI Server - Question for Group

Sloth mt_horeb at yahoo.com
Fri Mar 29 15:13:24 EST 2002


Again, thanks for all of the thoughtful replies.  I've tried each of
them, and I still get the same result:
1) The server starts and will serve HTTP.
2) Upon submitting a GET request, the Windows ME OS "beeps" once
3) The page hangs without returning the result.
4) The WinME machine needs to be powered down completely, or it will
hang indefinitely.

Strange result, I'm sure you'll all agree...

My guess is that this has more to do with WinME than anything else. 
Apache serves CGI just fine.  Tomcat will also serve Servlets without
complaining.

Any experience in the group with WinME or a similar issue with Win 9x?

Thanks again!

Jeremy.

sandskyfly at hotmail.com (Sandy Norton) wrote in message news:<b03e80d.0203290635.59a7a47d at posting.google.com>...
> Jeremy wrote:
>     
> > I want to be able to do - have Python start a CGI server, serve a
> > page, get form data, get data from a database, and display dynamic
> > content.  I don't need anything industrial strength, just something
> > that can handle a single user.
> 
> 
> OK. This one has bugged me before even though it's actually quite simple:
> 
>     <tested on win2k py2.2>
> 
> [1] create the script that will instanciate CGIHTTPServer (server.py)
>     # this is my favorite part (-:
>     from CGIHTTPServer import test as serve
>     if __name__=='__main__': serve()
> 
> [2] create an html file which is going to call your python cgi script (test.html)
>     <html>
>     <head>
>         <title>CGI Test</title>
>     </head>
>     <body>
>         <form name="myform" action="cgi-bin/testcgi.py" method="GET">
>             <input type='text' name='query' size="40">
>             <input type="submit" value=' search '>
>         </form>
>     </body>
>     </html>
> 
> 
> [3] create a folder in the same directory as the two files above (cgi-bin)
> 
> [4] create the script that will be called by your html file (testcgi.py)
>     #!python
>     
>     import cgi   
>     print "Content-Type: text/plain\n\n"
>     form = cgi.FieldStorage()
>     for name in form.keys():
>         print "Input: " + name + " --> " + form[name].value + "\n"
>     print "Finished!"
> 
> [5] point your browser to http://localhost:8000/test.html
>     
>     and enjoy.
> 
> ciao
> 
> Sandy



More information about the Python-list mailing list