Deformed Form

Stephen Hansen me+list/python at ixokai.io
Fri Jun 11 15:43:12 EDT 2010


... This is the first time you've actually clearly expressed what you're
doing.

On 6/11/10 12:11 PM, Victor Subervi wrote:

I dub thee Script1.py:
> *** RIGHT HERE! ***
> 
>   print "<input type='text' size='2' maxlength='2'
> name='new_passengers_curr_customers' /><br />"
>                                                        
> *** SEE IT? ***

Mmhmm.

I dub thee Script2.py:
> *** NOTE THIS: ****
>   new_passengers_curr_customers = New_Passengers_Curr_Customers(customers,
> flights)
> *** THAT LINE ****

Okay.

I dub thee Script3.py:
> import cgitb; cgitb.enable()
> import cgi
> 
> form = cgi.FieldStorage()
> 
> def New_Passengers_Curr_Customers(customers, flights):
> 
> *** RIGHT HERE. SEE THIS LINE? WHY DOES IT WORK HERE AND NOT IN THE 2ND
> SCRIPT IN THIS HERE EMAIL WHERE IT SHOULD WORK???***
>   new_passengers_curr_customers =
> int(form.getfirst('new_passengers_curr_customers', 0))
> *** THAT LINE ABOVE. RIGHT ABOVE HERE. OK?? ***

The only reason that moving the lines
  form = cgi.FieldStorage()
and
  blah = int(form.getfirst("blah", 0))

from Script3 to the exact place in Script2 (notwithstanding my not
wanting to type absurdly long variable names :P) wouldn't work, is if
you didn't move the lines correctly. Those will absolutely work just
fine in Script2.py. You had to have done it wrong. Maybe typo'd.

Show the traceback.

Hint: Never say it "doesn't work", or "I can't do this here", or "it
won't" or "it can't. Show the actual traceback and the actual (not
retyped) chunk of code.

-- 

   Stephen Hansen
   ... me+list/python (AT) ixokai (DOT) io

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100611/d2d18424/attachment-0001.sig>


More information about the Python-list mailing list