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!newsfeed3.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; '16,': 0.03; 'languages.': 0.04; 'work!': 0.07; 'spec': 0.09; 'terms,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'language,': 0.12; '3:51': 0.16; 'closure,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sorts': 0.16; 'subject: \n ': 0.16; 'subject:GUI': 0.16; 'subject:programming': 0.16; 'subject:python': 0.16; 'apps': 0.16; 'followed': 0.16; 'wrote:': 0.18; '(in': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'cc:2**0': 0.24; 'url:edu': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'michael': 0.29; '[1]': 0.29; "doesn't": 0.30; 'compared': 0.30; 'dec': 0.30; 'subject:please': 0.30; 'especially': 0.30; 'message-id:@mail.gmail.com': 0.30; 'too.': 0.31; 'context.': 0.31; 'factor': 0.31; 'know.': 0.32; 'done.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'var': 0.36; 'should': 0.36; 'application': 0.37; 'being': 0.38; 'skip:o 20': 0.38; 'pm,': 0.38; 'enough': 0.39; 'simple': 0.61; 'great': 0.65; 'overall': 0.69; 'obvious': 0.74; 'subject:want': 0.91; 'why?': 0.91; 'to:none': 0.92; 'subject:answer': 0.95; '2013': 0.98 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=cWRIV16C/CdLcyR+vCWy9awbyALlgpc/6DSaXn/eI7s=; b=N+lzNWTFb206JwP25fEwgul2SWzNvMtzTQBK3b56a7DtYj3p+oeDGrTzrhH+ogXHIz Dk5NNQ26l0AeKeIDMsM1NYo9XqskkGFend37DCHV8ZRY9h4tEYIC52vXBojODtw2BSvl EhH/IC1fD+rO9e/aj/eINVxFEbu+p8Ro4O5ZgOOBZfXczYjCR6FLElsSui5bV4FTAynY xSbarhuC5OqWImYnEf14RY0NTf9fX0HRiMnGJ0Jf0ziOOzwjGjbReU91QQBHEZG/dbYy T8elpA0lBCc1oSu47KLyDgENS5MlzGOX1ueqGPop6vYFkB2slnG7Pn306AVjGNIKBmFY fbIg== MIME-Version: 1.0 X-Received: by 10.66.65.134 with SMTP id x6mr18095019pas.142.1387170486656; Sun, 15 Dec 2013 21:08:06 -0800 (PST) In-Reply-To: <52AE86E5.70409@gmail.com> References: <9f5d28ce-504d-40db-baa2-ff3699ab05c7@googlegroups.com> <52AE4A86.8040402@arcor.de> <52AE86E5.70409@gmail.com> Date: Mon, 16 Dec 2013 16:08:06 +1100 Subject: Re: GUI:-please answer want to learn GUI programming in python , how should i proceed. 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387170489 news.xs4all.nl 2851 [2001:888:2000:d::a6]:57692 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62004 On Mon, Dec 16, 2013 at 3:51 PM, Michael Torrie wrote: > I think Python is a great overall application development language, > especially for the GUI. First-class functions for callbacks make it > very nice compared to other languages. Python is fast enough for > full-blown apps too. Slow parts can be factored out to other languages. Python is sooooooo slow when it waits for the human. That pesky input() function can take *minutes* to return. It's terrible! Factor that out and your job's done. And yeah. First-class functions *rock*. ECMAScript is almost there - not supremely, perhaps, but oh so "all-but"! [1] A function can retain all sorts of state by being a closure, and yet somehow it doesn't retain the state of which 'this' (in Python terms, 'self') it should reference. Why? I don't know. But it's part of the spec now, so callbacks have to take a function and a context. var func=document.getElementById; var foo=func("foo"); /* Won't work */ function funcgen(obj) { return function(desc) {return obj.getElementById(desc);} } var func=funcgen(document); var foo=func("foo"); /* Will work! */ In Python, the simple and obvious thing works, because there's less magic. The incantation "obj.member" followed by the incantation "callable(args)" has exactly the same meaning as "obj.method(args)". ChrisA [1] http://math.boisestate.edu/gas/patience/webop/pat16d.html