Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32210

Re: Question about long-running web scripts

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'true,': 0.04; 'socket': 0.05; 'frontend': 0.07; 'php.': 0.07; 'subject:Question': 0.07; 'python': 0.09; '(instead': 0.09; 'indeed,': 0.09; 'php,': 0.09; 'python:': 0.09; 'script,': 0.09; 'scripts,': 0.09; 'cc:addr:python-list': 0.10; '(say': 0.16; '.py': 0.16; 'confusion': 0.16; 'describing': 0.16; 'distinction': 0.16; 'equivalents': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'gilles': 0.16; 'message- id:@timgolden.me.uk': 0.16; 'mode)': 0.16; 'oct': 0.16; 'php:': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'simplest': 0.16; 'tcp': 0.16; 'tjg': 0.16; 'ways:': 0.16; 'www': 0.16; 'wrote:': 0.17; 'certainly': 0.17; 'mechanism': 0.17; 'thu,': 0.17; 'tim': 0.18; '>>>': 0.18; 'app': 0.19; 'runs': 0.22; 'cc:2**0': 0.23; 'apps': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'least': 0.25; 'cc:addr:python.org': 0.25; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'leave': 0.26; 'run': 0.28; '+0100,': 0.29; 'cgi': 0.29; 'loop,': 0.29; "people's": 0.29; 'scheme.': 0.29; 'framework': 0.30; 'unlike': 0.30; 'version,': 0.30; 'basic': 0.30; 'etc.)': 0.32; 'running': 0.32; 'could': 0.32; 'certain': 0.33; 'explains': 0.33; 'legacy': 0.33; 'received:192.168.100': 0.33; 'handle': 0.33; 'another': 0.33; 'thanks': 0.34; 'server': 0.35; 'protocol': 0.35; 'there': 0.35; 'but': 0.36; 'loaded': 0.36; "didn't": 0.36; 'does': 0.37; 'two': 0.37; 'uses': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'some': 0.38; 'things': 0.38; 'instead': 0.39; 'received:192': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'think': 0.40; 'easy': 0.60; 'time,': 0.62; 'skip:n 10': 0.63; 'here': 0.65; 'incoming': 0.69; 'from:addr:mail': 0.71; 'actually,': 0.84; 'apart.': 0.84; 'hood': 0.84; 'route': 0.84; 'subject:long': 0.84; 'subject:running': 0.84; 'tease': 0.84; 'to:none': 0.93
Date Fri, 26 Oct 2012 12:00:17 +0100
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version 1.0
CC python-list@python.org
Subject Re: Question about long-running web scripts
References <nm8i889v1p5orgk4dkvtcurguk11lvm6r8@4ax.com> <mailman.2838.1351166605.27098.python-list@python.org> <skci88lm21ldghic8k4leo8n6tminmam5l@4ax.com> <mailman.2840.1351171460.27098.python-list@python.org> <9bnk88dur0dth363vc492ibk8fhcd19nu7@4ax.com>
In-Reply-To <9bnk88dur0dth363vc492ibk8fhcd19nu7@4ax.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2890.1351249221.27098.python-list@python.org> (permalink)
Lines 46
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351249221 news.xs4all.nl 6871 [2001:888:2000:d::a6]:36674
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:32210

Show key headers only | View raw


On 26/10/2012 10:58, Gilles wrote:
> On Thu, 25 Oct 2012 14:24:16 +0100, Tim Golden <mail@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.

I think that this is the distinction you're making:

PHP: mod_php (fastcgi mode) runs myscript.php

Python: <some python fcgi frontend>.py runs myscript.py

which is, essentially, true, not least because PHP and web apps are
pretty much synonymous in many people's minds. Both ways: the only thing
PHP does is web; the simplest route to a web app is PHP.

Certainly there are Python equivalents (mod_python, mod_wsgi, etc.)
which can run in effectively the same way as mod_php, and they could be
configured to run an fcgi frontend script, I presume. There's always a
certain confusion here because you can often one mechanisms (say,
mod_wsgi) to act as another (say legacy one-shot CGI) and because some
things are both mechanism and protocol and it's not always easy to tease
the two apart.


> 
> 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.

Good scheme.

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-25 13:45 +0200
  Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-25 13:03 +0100
    Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-25 14:40 +0200
      Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-25 14:24 +0100
        Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 11:58 +0200
          Re: Question about long-running web scripts Tim Golden <mail@timgolden.me.uk> - 2012-10-26 12:00 +0100
            Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 13:37 +0200
  Re: Question about long-running web scripts David Hutto <dwightdhutto@gmail.com> - 2012-10-25 08:53 -0400
    Re: Question about long-running web scripts Gilles <nospam@nospam.com> - 2012-10-26 11:56 +0200

csiph-web