[Tutor] cgi question

Peter Curran peterc73@pacbell.net
Fri, 18 Aug 2000 21:23:42 -0700


Hello everyone.

I am having a problem with the feedback.py program which begins on page
276 of O'Reilly's Learning Python.  Basically, the script processes
input from an HTML form, returns a confirmtation form, and writes the
input to disk.  I've typed the script in exactly as it appears, checked
it for errors within the Python IDE, referenced the path and name of the
script in the ACTION attribute of my HTML form.  The form displays ok in
the browser, so I input my data and click "submit."

Instead of displaying the results from "gush" or "whimper" -- the
routines which process the cgi input, the whole python script appears in
the browser -- just exactly as it appears in the Python IDE.  If this is
clue enough for you, stop reading.  Otherwise, read on.

I noticed that the O'Reilly explanation on pg. 279 says: "To start, the
first line of the program needs to refer to the python executable. ...
The second line includes import cgi ..."

I'm confused because the first line of the script IS the import cgi
line, and there IS NO other first line in the book.  Is something
missing from their code snippet, or have I neglected to do something
very basic to scripting with Python?

Anyone know what the first line ought to be, or what I'm doing wrong?

Thanks in advance to whomever answers, thanks also to the list admins.
Via con huevos.

Peter Curran
UniLink Inc.
(415) 751-1285 (h/w)
(415) 378-9663 (m)
(425) 928-5312 (f)