On 6/11/10 4:46 AM, Victor Subervi wrote: > 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,
I do not assume. I know. With CGI, each web request is independent. This is simple fact. The web server launches Python, Python runs a script, Python returns a string containing the result, *Python closes*. The web host sends that string to the client. The Python application *ends*. Its memory is cleared. It is gone. This is how CGI works (and why CGI is almost never used anymore, as it is quite slow as a result-- most people use something like FastCGI or WSGI either with a long-running daemon Python process or embedding Python into Apache itself). When the next request comes in, it all starts up again: each request has only the information provided to it, either in cookies, the environment variables (there's quite a few interesting ones), and the request parameters. This is *how it works*. This is not some vague guess of mine. This is *years* of experience of *actually* doing *exactly* what you're doing (while at the time actually making an attempt to understand the actual processes going on instead of just moving things around in files and observing the results to guess what's going on under the covers). Sure, if you have some file that two separate scripts import, and in said file you generate some value-- as long as that value will be the same at all times, it'll appear that the two scripts are sharing some state. They are not, however. The two scripts can not communicate. > 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. And this comment ends my attempt at assisting you, for multiple reasons (from the utter absurdity of you insisting we understand you when you take insultingly little care to actually express your problems clearly, to your arrogant and repeated refusal to take advice that is given, to your abject rudeness here, and so on). -- Stephen Hansen ... me+list/python (AT) ixokai (DOT) io
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list