Deformed Form

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


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

-------------- 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/c9f2b063/attachment-0001.sig>


More information about the Python-list mailing list