Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'interpreter': 0.04; 'socket': 0.05; 'subject:Question': 0.07; 'url:node': 0.07; 'python': 0.09; '(instead': 0.09; 'indeed,': 0.09; 'scripts,': 0.09; 'cc:addr:python-list': 0.10; 'sections': 0.13; '(the': 0.15; 'describing': 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; 'oct': 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; 'tcp': 0.16; 'titled': 0.16; 'tjg': 0.16; 'wrote:': 0.17; 'thu,': 0.17; 'tim': 0.18; 'not,': 0.21; 'runs': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'leave': 0.26; 'question': 0.27; 'run': 0.28; '+0100,': 0.29; 'cgi': 0.29; 'loop,': 0.29; "i'm": 0.29; 'basic': 0.30; 'generally': 0.32; 'running': 0.32; 'choosing': 0.33; 'received:192.168.100': 0.33; 'likely': 0.33; "can't": 0.34; 'but': 0.36; 'loaded': 0.36; "didn't": 0.36; 'uses': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'mean': 0.38; 'some': 0.38; 'description': 0.39; 'instead': 0.39; 'received:192': 0.39; 'little': 0.39; 'where': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'here:': 0.62; 'time,': 0.62; 'url:15': 0.65; 'url:6': 0.65; 'incoming': 0.69; 'from:addr:mail': 0.71; '(your': 0.84; 'actually,': 0.84; 'confusion.': 0.84; 'subject:long': 0.84; 'subject:running': 0.84; 'to:none': 0.93 Date: Thu, 25 Oct 2012 14:24:16 +0100 From: Tim Golden 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: In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351171460 news.xs4all.nl 6986 [2001:888:2000:d::a6]:46947 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32124 On 25/10/2012 13:40, Gilles wrote: > On Thu, 25 Oct 2012 13:03:14 +0100, Tim Golden > wrote: >> (Your question is a little confused at the end. I'm choosing to >> understand: why can't we just run Python one-shot, like CGI? The likely >> alternative meaning is: why can't the incoming request be routed to an >> already-running Python program -- which is not, of course, what CGI >> generally does. Hence my confusion). > > Yes indeed. Sorry about the confusion. > > 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). The key description is here: http://www.fastcgi.com/drupal/node/6?q=node/15 (The sections have no anchors; you're looking for the section titled "2. FastCGI Interface") TJG