<div class="gmail_quote">On Thu, Jun 10, 2010 at 2:07 PM, Stephen Hansen <span dir="ltr"><me+list/<a href="mailto:python@ixokai.io">python@ixokai.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 6/10/10 10:48 AM, Victor Subervi wrote:<br>
> Now, create_edit_passengers3() is called by the form/submit button in (you<br>
> guessed it) create_edit_passengers2.py, the latter containing a var in it<br>
> which *should* be accessible to create_edit_passengers3.py, one would think.<br>
<br>
</div>Wait, wait, wait.<br>
<br>
If a user is browsing to, say,<br>
<a href="http://example.com/create_edit_passengers2.py" target="_blank">http://example.com/create_edit_passengers2.py</a>; that script will be run,<br>
and once -done-, print out a form which the user sees.<br>
<br>
At that point, create_edit_passengers2.py is dead. Gone. Over.<br>
<br>
Once a person then clicks Submit, and the form is sent to<br>
<a href="http://example.com/create_edit_passengers3.py" target="_blank">http://example.com/create_edit_passengers3.py</a>; its a whole new<br>
environment (assuming you're using CGI, which it appears you are).<br>
<br>
The *only* way for state or data to get from one script to another is<br>
not importing, or shared variables, or anything like that: you *have* to<br>
pass it into that form, and extract it from the resulting form. You can<br>
pass the actual variables as a <input type="hidden">, and then extract<br>
it like any of the user-fields. Or, you can write out your state to a<br>
local file with some unique ID, and just write out into the form that<br>
unique ID. Or use a cookie session. Etc.<br>
<br>
You *can't* pass variables around script-to-script among separate CGI<br>
sessions. It just totally doesn't work like that. Any success you think<br>
you have had is false; it works by mere accident or illusion. Each CGI<br>
script stands alone. It starts, runs, executes, then closes. No state is<br>
preserved unless you *explicitly* preserve it.<br></blockquote><div class="im"><br>You know, if this were the first time I'd worked with "passing variables around" through cgi, I'd think you may be right. But answer me this: if what you assume is correct, how in the heck is this variable being generated (and it is) in <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers2.py</a> (as an <input type="text"...>) and then being reinstantiated in another script? That is, if what you say is true, I should not be able to access it through ANY script whatsoever after <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers2.py</a> is "dead", right??? Look closely:<br>
<br>1) variable value generated is <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers2.py</a><br>2) <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers2.py</a> calls <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers3.py</a> via a <form...> and passes the value of the var thereunto.<br>
3) theoretically! Yet for some reason I can't call it in <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers3.py</a> but *can* call it in a script that is imported by <a href="http://example.com/create_edit_passengers2.py" target="_blank">create_edit_passengers3.py</a><br>

<br>Now you guys can make fun of me all you want, but until you actually READ and UNDERSTAND what I'm writing, I'm afraid I think your criticisms are ridiculous and make you look like fools. For those who don't criticize me and are trying to help but misunderstand, hey, what can I say, who misunderstand so much myself lol.<br>
TIA,<br>beno<br></div></div><br>