Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Terry Reedy Newsgroups: comp.lang.python Subject: Re: Understanding Python from a PHP coder's perspective Date: Mon, 7 Dec 2015 16:53:48 -0500 Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de X1Vg+YbS04fwMLvwWfrfAgoVStENLBpgnjArTQqUp0SA== Return-Path: 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; 'python,': 0.02; 'subject:Python': 0.05; 'differently': 0.07; 'appropriate.': 0.09; 'php,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'script,': 0.09; 'visited': 0.09; 'python': 0.10; 'python.': 0.11; 'jan': 0.11; 'apache': 0.14; '.py': 0.16; 'accesses': 0.16; 'different?': 0.16; 'event-driven': 0.16; 'extensions,': 0.16; 'json,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'reedy': 0.16; 'something.': 0.16; 'subject:perspective': 0.16; 'url:example': 0.16; 'url:py': 0.16; 'wrote:': 0.16; 'obviously': 0.16; 'extension': 0.20; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'script': 0.25; "i've": 0.25; 'header:User-Agent:1': 0.26; 'command': 0.26; 'header:X-Complaints-To:1': 0.26; 'mostly': 0.27; 'expose': 0.29; 'initiated': 0.29; 'loop,': 0.29; 'websites.': 0.29; 'code': 0.30; 'getting': 0.33; 'run': 0.33; 'driven': 0.33; 'html,': 0.33; 'similar': 0.33; 'languages': 0.34; 'file': 0.34; 'running': 0.34; 'so,': 0.35; 'but': 0.36; 'should': 0.36; 'received:71': 0.36; 'to:addr:python-list': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'aspects': 0.37; 'missing': 0.37; 'seem': 0.37; 'mean': 0.38; 'why': 0.39; 'subject:from': 0.39; 'to:addr:python.org': 0.40; 'called': 0.40; 'some': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.62; 'more': 0.63; 'excited': 0.63; 'interest': 0.64; 'accessed': 0.66; 'saw': 0.77; 'browser.': 0.81; 'all!': 0.84; 'extensions.': 0.84; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: pool-71-185-227-36.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100111 On 12/7/2015 4:07 PM, villascape@gmail.com wrote: > Hello all! Just started getting into Python, and am very excited about the prospect. > > I am struggling on some general concepts. My past experience with server-side code is mostly limited to PHP and websites. I have some file called "whatever.php", the browser accesses it, and PHP parses it and returns HTML, JSON, etc. Every now and then, I need to run some background PHP script, or have some PHP script initiated by a CRON job, or have some PHP script initiated by the command line running in an endless loop, and while it works, feel other languages might be more appropriate. > > So, my interest in Python... > > I've read up on Python, and while some aspects seem similar to PHP, some don't. I have learned how to create Python script, have run it from the command line, and have even accessed it with Apache by placing http://example.com/myscript.py in the browser. I am used to seeing .php extensions, but never .py extentions, and even visited multiple sites which I knew were written in Python, but never saw the browser expose the .py extensions. I am obviously missing something. > > Why don't I see the .py extension in my browser? Better security, I believe. > Is Python event driven like PHP, or is it somehow different? Python is not event-driven as you mean it, but you can do event-driven systems in Python. > How should I view Python differently than PHP? You should formulate your own general view. For specific aspects, ask more specific quesitons, like you did above. -- Terry Jan Reedy