Submit web form only client-side with Python? COM?

Paul Rubin http
Sun Aug 5 00:05:23 CEST 2007


goldtech <goldtech at worldpost.com> writes:
> So I can present the user with an HTML form in it - but how can I
> write the form data to a local file on my work station?

The simplest way is with the cgi and CGIHTTPServer modules.  You'd
write your form in an html file, with the target set to a Python
script that you'd write as a cgi.  Then you'd write a trivial CGI HTTP
server (look at the example code in the comments) with CGIHTTPServer.
The user would point their browser at your server (you could make a
desktop shortcut for that), the browser shows the html file, and the
submit button sends the form contents to your cgi.

This is very basic, old-school web programming, not as flexible or
high-performance as using the fancy frameworks, but a lot simpler for
limited applications like what you're describing.



More information about the Python-list mailing list