[Tutor] Questions on CGI script
Kent Johnson
kent_johnson at skillsoft.com
Sat Aug 21 14:44:06 CEST 2004
Shufen,
What are the details of the Server Error?
VoidSpace has a few CGI examples you could look at.
cgi-shell is very simple example - it creates a form with one entry field
that accepts a shell command. When you submit the form it executes the
command and shows you the result.
http://www.voidspace.org.uk/atlantibots/cgi-shell.py
nangram is a more complex example -
http://www.voidspace.org.uk/atlantibots/pythonutils.html#nana
Kent
At 08:53 AM 8/21/2004 +1000, Ms Soo Chong wrote:
>Thanks Kent for the useful example but I'm still having some problem.
>I tried the typing the code (from the webpage) and generate it, hope to
>see some output
>and learn from there. But it shows Server Error on the web browser. (After
>reading
>through the example - Writing CGI programs in python, I thought I
>understand whats
>going on but in fact maybe not, since I still failed to generate a form
>and output.)
>
>http://www.devshed.com/c/a/Python/Writing-CGI-Programs-in-Python
>
>I wanna to display a text box where user type their query msg and a submit
>box to
>process the query. Should I create another html file and open in read mode
>in my actual script? Then,
>
>import cgi
>form = cgi.FieldStorage()
>
>It may be simple to alot of people but sorry I don't really understand the
>procedure
>of writing a cgi script. Can someone please help me by giving a simple
>example on
>generating a search and displaying the result? Greatly appreciated.
>
>I have been trying for the past two days without bothering python tutors
>but I still can't get it done. HELP.
>
>Thank you in advance.
>
>Shufen
>
>
>
>
>
>
>
>
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
More information about the Tutor
mailing list