Deformed Form

Stephen Hansen (L/P) me+list/python at ixokai.io
Thu Jun 10 10:30:08 EDT 2010


On 6/10/10 7:14 AM, Victor Subervi wrote:
> Hi;
> I have a script that calls values from the form that calls it. This script
> imports another script:
> 
> from New_Passenger import New_Passenger
> 
> def create_edit_passengers3():
>   ...
>   new_passengers_curr_customers = New_Passengers_Curr_Customers(customers,
> flights)
>   if new_passengers_curr_customers > 0:
>     print "<input type='submit' value=' Send ' />"
> 
> All this works. What puzzles me, however, is that the value of
> new_passengers_curr_customers has to be called using cgi from the imported
> script (New_Passenger). It cannot be called from the calling script. I would
> have thought it would have been the other way around. Please help me
> understand why.

I can't quite figure out what you're asking.
new_passengers_curr_customers is a variable local to
create_edit_passengers3; you have something that differs only in case
called New_Passengers_Curr_Customers which -- I assume is defined,
somewhere. Then you haev New_Passenger, and I'm not sure I see what it
has to do with anything.

But what does "cannot be called" mean? "Cannot" usually means "an error
happened" -- in which case you shouldn't really even mention it unless
you're gonna back it up with a traceback.

The former is a value, you don't call it. You access it. And it being
local, you can surely only access it within that function (unless you
pass it somewhere). The latter is -- a class? A function? No idea, as
you haven't shown us. Nor shown any errors or any tracebacks or
*anything* to indicate what is possibly going on, let alone what is
going wrong when you, I presume, attempt to "call .. something .. from
the calling script". (???)

So either way... cannot be called?

+1 for "absolutely worst framed question of the day" :)

-- 

   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: 553 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100610/09e0e243/attachment-0001.sig>


More information about the Python-list mailing list