CGI module does not parse data

Fredrik Lundh fredrik at pythonware.com
Thu Dec 1 17:40:57 EST 2005


"amfr" wrot3e:

> I am writing a webserver, and I want it to be able to run python
> scripts.  But when I set sys.stdin to self.rfile (using the
> BaseHTTPServer class, self.rfile is a input stream containing the
> request), the cgi module does not parse the data.
> Example script:
> import cgi
> form = cgi.FieldStorage()
> print form["testfield"]
>
> The above script would print nothing.  Should i be setting sys.stdin to
> something else, or is there anthoer solution entirely?

are you writing your own CGIHTTPServer ?

http://docs.python.org/lib/module-CGIHTTPServer.html

why ?

</F>






More information about the Python-list mailing list