Oops. My bad. I did in fact have this line of code before calls to form:<br><br>form = cgi.FieldStorage()<br><br>I changed the except command from "pass" to "print sys.exc_info()" as per your suggestion. Still, however, the form just renews itself without offering any information whatsoever. You can see this here, if you like:<br>
<a href="http://13gems.com/test-Calculators_frame.py">http://13gems.com/test-Calculators_frame.py</a><br>TIA,<br>beno<br><br><div class="gmail_quote">On Thu, Jul 23, 2009 at 2:01 PM, Dennis Lee Bieber <span dir="ltr"><<a href="mailto:wlfraed@ix.netcom.com">wlfraed@ix.netcom.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thu, 23 Jul 2009 12:46:16 -0300, Victor Subervi<br>
<<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>> declaimed the following in<br>
gmane.comp.python.general:<br>
<div class="im"><br>
> sent. Here again is the code:<br>
><br>
> from primeNumbers import primeNumbers<br>
><br>
> try:<br>
> lang = form.getfirst('lang', 'en')<br>
<br>
</div> This code is incomplete -- where is "form" created? I see no<br>
"import"s that might define such...<br>
<div class="im"><br>
> browser = form.getfirst('browser', 'all')<br>
> site = form.getfirst('site', 'bridge')<br>
> num = form.getfirst('num','')<br>
> except:<br>
> pass<br>
<br>
</div> Since there is no such thing as "form" in the code you posted, the<br>
first "form.getfirst()" operation will raise an exception. That<br>
exception is then being ignored by this "pass".<br>
<br>
I'd suggest moving the code that outputs the HTTP response header<br>
and the HTML prelude material to the top, then replace "pass" with<br>
something that prints actual exception information (the stuff from<br>
sys.exc_info() )<br>
--<br>
Wulfraed Dennis Lee Bieber KD6MOG<br>
<a href="mailto:wlfraed@ix.netcom.com">wlfraed@ix.netcom.com</a> <a href="mailto:wulfraed@bestiaria.com">wulfraed@bestiaria.com</a><br>
<a href="HTTP://wlfraed.home.netcom.com/" target="_blank">HTTP://wlfraed.home.netcom.com/</a><br>
(Bestiaria Support Staff: <a href="mailto:web-asst@bestiaria.com">web-asst@bestiaria.com</a>)<br>
<a href="HTTP://www.bestiaria.com/" target="_blank">HTTP://www.bestiaria.com/</a><br>
<font color="#888888"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>