Path: csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'frameworks': 0.05; 'scripts': 0.09; 'python': 0.09; 'apache,': 0.09; 'part,': 0.09; 'php,': 0.09; 'script,': 0.09; 'subject:python': 0.11; 'correctly,': 0.16; 'describing': 0.16; 'googled': 0.16; 'inputs': 0.16; 'purposes.': 0.16; 'say.': 0.16; 'wrote:': 0.17; 'trying': 0.21; 'meant': 0.21; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'plain': 0.27; 'i.e.': 0.27; 'start,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'cgi': 0.29; "i'm": 0.29; 'goes': 0.33; 'handle': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'server': 0.35; 'data,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'really': 0.36; 'but': 0.36; 'useful': 0.36; 'should': 0.36; 'bad': 0.37; 'october': 0.37; 'why': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'build': 0.39; 'little': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'different': 0.63; 'here': 0.65; 'to,': 0.65; 'webpage': 0.65; 'lightweight': 0.84; 'way...': 0.84; 'do:': 0.91; 'hands': 0.97 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:content-type :x-gm-message-state; bh=ms0MBJaaBE5R/VCbJ8H4ygrXEM5GtTgUFbxRbajA2zA=; b=QFY/PUVGOtaQNVspfRARNrSTzUyJ0dUf1dgKNHVE/SlHcS//b3Lix35AGQtevTR6Ur sOYzrl5Zr1e2gCxl7kbKufToX3Yk5p5pceQj50FNMn7T1LvInV5tAsjR4UuM0mCvzIBd mF4BoGMBX0xmMZOIQYi55At3yOIyB7bI3xie01AZnccnqHMLBdn5mC5o9eb+WWYuYWlL VcPhBkbZ3bQRVq5FACaSY4vWlnVEKtqaEByficfMdIG7B2DHX6U0aKf4J2OB0VzeoYz5 MTa661t+CI3stekDXIygYYJrJGc2XhNQCsRhaP1w64hsWqb07vXCQpJ4NYjsGXNYyPat b3lA== MIME-Version: 1.0 Sender: z@etiol.net X-Originating-IP: [190.104.26.20] In-Reply-To: References: <98b7e362-14fd-4721-84c8-ae1bc11febac@googlegroups.com> From: Zero Piraeus Date: Thu, 18 Oct 2012 03:57:34 -0400 X-Google-Sender-Auth: xhV1EIAjqicKrDe8B4H7gPhzSGQ Subject: Re: python scripts for web To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQk56DHpDdTsjLkdL72vSfurFkKQtySDL3CoDJuX5gD7mPfuhs0FLmETkQvVIVTUjNuuMGfg 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350547078 news.xs4all.nl 6882 [2001:888:2000:d::a6]:56362 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31606 : On 18 October 2012 03:18, wrote: > Here is what I need to do: on some webpage (done in php, or any other > different technology), user inputs some data, that data and the > request then goes to the server where python scripts calculate > something and return the result to the users end. > > Now, how do I do that server part, listening to requests, and calling > python scripts? If I understand you correctly, what you're describing here is a webserver - i.e. Apache, nginx etc. I'm not sure why you'd want to write one of those if you're as inexperienced as you say. > I googled about that but I do not understand if I should do that by > CGI, Flask, mod_wsgi, or any other way... I know to little about that > to understand what is the way to go. :/ These are all approaches to writing the software that the webserver hands the request off to, which is a different thing. If that's what you really meant to ask (how to write a script that processes a request and returns a response), then plain CGI might be the best place to start, if you're trying to get a handle on what's going on. Once you're happy that you understand how to build a plain CGI script, frameworks [like Flask] can be very useful ... and Flask is both lightweight and has good documentation, so it's not a bad choice for learning purposes. -[]z.