faqts : Computers : Programming : Languages : Python : Common Problems : Web Programming

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 6 people (83%) answered Yes
Recently 2 of 3 people (67%) answered Yes

Entry

I wonder if there is a way for Python to read directly the user input of a HTML form?

Aug 9th, 2000 21:13
unknown unknown, Richard Chamberlain


You can use the cgi module.

There is an example of exactly that at:

http://www.devshed.com/Server_Side/Python/CGI/page4.html

You should probably read the whole article:

http://www.devshed.com/Server_Side/Python/CGI/

A good place to start for these topics:

http://www.python.org/topics/web/basic-cgi.html

Specifically cgi.FieldStorage(). This returns a dictionary of values 
that have been passed by a form.