Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'interpreter': 0.05; 'python)': 0.05; 'subject:Open': 0.05; 'aggregate': 0.07; 'nested': 0.07; 'puts': 0.07; 'subject:Question': 0.07; 'steve': 0.09; 'rewrite': 0.09; 'scripts,': 0.09; 'second.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; 'language,': 0.12; '(unlike': 0.16; '3.3,': 0.16; 'command-line': 0.16; 'encodings': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hayes': 0.16; 'massively': 0.16; 'notation': 0.16; 'readability': 0.16; 'subject: \n ': 0.16; 'subject:java': 0.16; 'subject:programming': 0.16; 'unicode,': 0.16; 'subject:python': 0.16; 'for?': 0.16; 'java,': 0.16; 'wrote:': 0.18; 'library': 0.18; 'bit': 0.19; 'numerical': 0.19; "python's": 0.19; 'seems': 0.21; 'programming': 0.22; 'network,': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'convenient': 0.24; 'lets': 0.24; 'own.': 0.24; 'fairly': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'first,': 0.26; 'handling': 0.26; 'this:': 0.26; 'least': 0.26; '(for': 0.26; 'read,': 0.26; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'on,': 0.29; 'related': 0.29; 'subject:please': 0.30; 'especially': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; '(which': 0.31; 'code': 0.31; 'libraries': 0.31; 'such.': 0.31; 'this.': 0.32; 'probably': 0.32; 'run': 0.32; 'text': 0.33; 'subject:with': 0.35; 'something': 0.35; 'operations': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'version': 0.36; 'really': 0.36; 'consistent': 0.36; 'idle': 0.36; 'doing': 0.36; "didn't": 0.36; 'subject:?': 0.36; 'server': 0.38; 'files': 0.38; 'pm,': 0.38; 'rather': 0.38; '12,': 0.39; "couldn't": 0.39; 'extremely': 0.39; 'functional': 0.39; 'heard': 0.39; 'how': 0.40; 'easy': 0.60; 'most': 0.60; 'entire': 0.61; 'matter': 0.61; "you're": 0.61; 'times': 0.62; 'different': 0.65; 'worth': 0.66; 'benefit': 0.68; 'six': 0.68; 'results': 0.69; 'user,': 0.69; 'internet': 0.71; 'heavy': 0.81; 'etc),': 0.84; 'forced': 0.84; 'gains': 0.84; 'pocket': 0.84; 'novice': 0.91; 'superb': 0.91; 'url:comments': 0.91; 'to:none': 0.92; 'average': 0.93; 'suited': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=aMb7hJBt+XiNDsAuSMeZEAQD6GaByb/7rs4RzdtRqTU=; b=UBxF0af5Fkl55uwzkJWt8W31GjRg5bmQDA2PZGS/R3wW0heJ4kF5yDffYsoC80kvnm phtpFC/iGAbBas+CKI1BWJ4wMrNu4LfkDqzfbzysoEvZw+mCAPs7SL0NQIIUiA+6GYN1 /6Nd5z2pC2kzCcl7KISjt0Ev62m2Kv7VIxGIF06oSwwWv56ncEqfcIA6bMl59pS2svwx 4jxnoxb2yd4qRK2i/0vWXODXPQL7IVm87yUOIschqqqam7Rh8PgLCO/pggzYFeKfGfto eOh66ARu+u9Ed5LW4yXmoNyzPpPPll2RmUw9FWo0g700Xi6W3jFV73S/Va7mAoKC+lbc Uvjw== MIME-Version: 1.0 X-Received: by 10.66.118.71 with SMTP id kk7mr22182825pab.14.1389506325315; Sat, 11 Jan 2014 21:58:45 -0800 (PST) In-Reply-To: References: <18b67e59-39d1-41e2-8977-b1c449b132e7@googlegroups.com> Date: Sun, 12 Jan 2014 16:58:45 +1100 Subject: Re: Open Question - I'm a complete novice in programming so please bear with me...Is python equivalent to C, C++ and java combined? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389506333 news.xs4all.nl 2900 [2001:888:2000:d::a6]:46643 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:63753 On Sun, Jan 12, 2014 at 4:08 PM, Steve Hayes wrote: > So the question is, which kinds of programs is Python best for? > > I'm a novice at it, so it's a question that concerns me. From what I've heard > and read, it seems to be a fairly good general-purpose language, and it seems > to be most used for writing web applications (though that is not something I > am particularly interested in). Python puts heavy focus on code readability (which also means it's easy to write). So it gains you hugely for small scripts, less so for things that need to run millions of times a second. Python has a variety of libraries that make it well suited to internet applications (as server or as client). Python, especially as of version 3.3, is superb at handling internationalization, Unicode, and related messes - you can sort out files of different encodings and rewrite them in something consistent (eg UTF-8). It may seem a bit harder at first, as you're forced to think about the meaning of bytes and what's text and so on, but it's worth it. Python is NOT good at massively parallel numerical calculations.... on its own. But there are libraries that can do that sort of thing for you (NumPy, SciPy); I've no idea how good they are because I neither use them nor write code that would benefit from them, but they're extremely popular and well-used. As a general rule, if your program is likely to spend most of its time waiting (for the disk, the network, the user, etc), then Python is probably at least as good a choice as C, Java, or any other language, and the question will come down to library support and such. Python is also an excellent "super pocket calculator". The reasonably-compact notation for aggregate operations (list comprehensions and such) lets you work with a functional programming style, and you can use step-by-step imperative programming in the same way. Want to calculate the average result of rolling six six-sided dice, and discarding any results below 14? Try this: http://www.kickstarter.com/projects/916188323/doublesix-dice-roll-better/comments?cursor=5623335#comment-5623334 (BTW, is there no better notation than six nested for/range for doing 6d6? I couldn't think of one off-hand, but it didn't really much matter anyway.) The incremental execution of Python's interactive interpreter (REPL) is extremely convenient for this. I personally like using IDLE for this, as (unlike command-line Python) it will recall and edit an entire suite, rather than one line at a time. Extremely handy. ChrisA