Decision (if, else) routine is not working as intended with CGI module

epsilon cesmiga at
Tue Jan 29 21:23:41 CET 2008


I'm running into trouble figuring this one out.  It seems that my
decision routine is not working as intended.  Does anyone know why my
output continues to utilize the "else" portion of the routine.

Thank you,



import cgi

print "Content-type: text/plain\n"
tag_form = cgi.FieldStorage(keep_blank_values=True)

#if not tag_form.has_key("fse00"):
if tag_form["fse00"] == "":
    fse000 = {"fse00": "0"}
    print "Printing fse000: ", tag_form["fse00"]
    print "Printing fse00: ", tag_form["fse00"]

More information about the Python-list mailing list