Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'string.': 0.04; 'indicating': 0.05; '21,': 0.07; 'keys,': 0.07; 'parameter': 0.07; 'if,': 0.09; 'target,': 0.09; 'wrong,': 0.09; 'api,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keys.': 0.16; 'world!")': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'string,': 0.17; 'typing': 0.17; 'received:209.85.214.174': 0.21; 'keys': 0.22; 'sends': 0.22; 'tells': 0.22; 'so.': 0.24; 'command': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'subject:please': 0.27; 'message-id:@mail.gmail.com': 0.27; "d'aprano": 0.29; 'far,': 0.29; 'steven': 0.29; 'strings,': 0.29; 'function': 0.30; 'sense': 0.31; "aren't": 0.33; 'to:addr:python- list': 0.33; 'received:google.com': 0.34; 'project': 0.34; 'thanks': 0.34; 'nov': 0.35; 'received:209.85': 0.35; 'except': 0.36; 'michael': 0.36; 'but': 0.36; 'depends': 0.36; 'method': 0.36; 'should': 0.36; 'does': 0.37; 'uses': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'called': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'further': 0.61; 'personally': 0.61; 'our': 0.65; 'replies.': 0.84; 'target.': 0.84 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:to :content-type; bh=SugNr8ST3AaAtmLuBNNGnfwD7BTTk5v8CbEPU9iIZ1I=; b=zGugDjb3wLiPw7fdF62167nF5kH3ciLAofYgDxHygxjLxyzX9aPBUId+xo4vob1oxj A1vsEEtrREKlNY3baifSxHIGErVwaiOIbk1BkpblD/p++bHUk+RPSBCqvPeq0URblkzI gjgslkqAK6E7htrTChFdjty0mwqtjTeh9AGl8YFoFRo1lon7+O/juatTOhcQdBnn7dLG fZuYEyA+mRkg5Tfhm6WUxyu1BgP2aGV1mthiNPIS9JsHaLc/XrKZlO7QBXKeMWCiZBDE z79rflgn+sixxz0bW3H/vyyV2SHpl8KwQ4/25iKpx+DT0Xdv2gJF26CboxxcSCrIbE2y m3HQ== MIME-Version: 1.0 In-Reply-To: <50abadf3$0$29987$c3e8da3$5496439d@news.astraweb.com> References: <3d71f175-164e-494c-a521-2eaa5679b524@googlegroups.com> <7290a127-97e1-4032-98ae-6e602b87b74b@googlegroups.com> <50abadf3$0$29987$c3e8da3$5496439d@news.astraweb.com> Date: Wed, 21 Nov 2012 07:57:26 +1100 Subject: Re: 10 sec poll - please reply! From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 1353445048 news.xs4all.nl 6870 [2001:888:2000:d::a6]:39276 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33659 On Wed, Nov 21, 2012 at 3:21 AM, Steven D'Aprano wrote: > On Tue, 20 Nov 2012 07:18:42 -0800, Michael Herrmann wrote: > >> Thanks again for your further replies. So far, it's 4 votes for >> 'send_keys' and 1 vote for 'type'. >> >> Regarding 'send_keys': To me personally it makes sense to send keys _to_ >> something. However, in our API, send_keys would not be called on an >> object or with a parameter indicating the target. It would just be >> >> send_keys(ENTER) >> send_keys("Hello World!") >> send_keys(CTRL + 'a') > > > "send_keys" is wrong, because you aren't sending keys. You're sending > strings, except you aren't actually sending strings either, because > "send" does not make sense without a target. You're automating the typing > of strings, including control characters. That depends on what the function actually does. If it sends a single command to blat a string, including control characters, to the target, then yes, it's sending a string. But if, as my reading of the OP tells me, the last one is "send press-Ctrl, send press-a, send release-a, send release-Ctrl", then it's sending keys, and the name should say so. And it's this method that the key-sender in the Yosemite project uses (though, for hysterical raisins, its function is called "dokey" - which I am NOT recommending). ChrisA