Question about long-running web scripts

Gilles nospam at nospam.com
Fri Oct 26 05:58:08 EDT 2012


On Thu, 25 Oct 2012 14:24:16 +0100, Tim Golden <mail at timgolden.me.uk>
wrote:
>> But actually, I didn't mean one-shot scripts, where the Python
>> interpreter + script must be loaded each time, but rather: If I leave
>> a Python running in an endless loop, why not just use either CGI or
>> some other basic way to call the script instead of FastCGI?
>
>In essence, you're describing FastCGI. A Python program (or, indeed, any
>program) which uses FastCGI runs continuously and waits for the incoming
>request on a TCP socket (instead of as a sys.stdin stream + env vars
>immediately after process startup).

Thanks for the clarification.

Since, unlike PHP, the Python interpreter is not available in a
FastCGI-capable version, this explains why the www server must be told
which specific Python script to run through FastCGI.

The reason I ask for all this, is that I want to understand how things
work under the hood before relying on a Python framework to handle the
nitty-gritty.



More information about the Python-list mailing list