[Tutor] Python/CGI question: multiple-screen interview

Terry Carroll carroll@tjc.com
Sat Apr 26 15:21:50 2003


This is probably as much a CGI question as Python, but I hope it's not too 
off-topic.

I want to write a Python web application (at this point, I'm thinking CGI) 
that asks the user a series of questions.  I don't want to do a one-page 
form, because a lot of questions will be inapplicable depending on earlier 
answers.[1]

This seems to require saving state in some way between invocations.  
What's the best approach for this?  Cookies?  Something else?

Would you do this as multiple Python CGI programs, one for each set of 
questions, or a single program that sets up some sort of dialog?

Finally, am I crazy for planning on doing this as CGI?  Should I be
thinking of doing it some other way, say as a Java servlet with Jython
(about which I know nothing)?


[1] An example may help.  My application is to determine the expiration of 
a particular work's U.S. copyright.  For works published prior to 1978, 
this is based on the publication date.  For works created 1978 or later, 
it's based on the date of the author's death.  So, if the user answers an 
early question that the work was published in, say, 1964, I don't want to 
ask if and when the author died; it doesn't matter, and won't affect the 
outcome.


-- 
Terry Carroll        |  "To have this rare opportunity
Santa Clara, CA      |    is a rare opportunity."
carroll@tjc.com      |    - Houston Rockets' Yao Ming, on being named
Modell delendus est  |    starting center for the 2003 NBA All-Star Game