Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33600 > unrolled thread

10 sec poll - please reply!

Started byMichael Herrmann <michael.herrmann@getautoma.com>
First post2012-11-20 04:18 -0800
Last post2012-11-29 03:45 -0800
Articles 20 on this page of 61 — 25 participants

Back to article view | Back to comp.lang.python


Contents

  10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-20 04:18 -0800
    Re: 10 sec poll - please reply! Chris Angelico <rosuav@gmail.com> - 2012-11-20 23:23 +1100
    Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-20 13:09 +0000
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-20 05:17 -0800
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-20 05:20 -0800
    Re: 10 sec poll - please reply! Dave Angel <davea@dejaviewphoto.com> - 2012-11-20 08:39 -0500
      Re: 10 sec poll - please reply! Neil Cerutti <neilc@norwich.edu> - 2012-11-20 14:39 +0000
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-20 07:18 -0800
      Re: 10 sec poll - please reply! MRAB <python@mrabarnett.plus.com> - 2012-11-20 15:59 +0000
      Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-20 16:21 +0000
        Re: 10 sec poll - please reply! Chris Angelico <rosuav@gmail.com> - 2012-11-21 07:57 +1100
        RE: 10 sec poll - please reply! "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-20 21:08 +0000
          Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 01:20 +0000
            Re: 10 sec poll - please reply! Tim Chase <python.list@tim.thechases.com> - 2012-11-20 19:39 -0600
      Re: 10 sec poll - please reply! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-20 16:31 +0000
      Re: 10 sec poll - please reply! Alan Meyer <ameyer2@yahoo.com> - 2012-11-20 18:46 -0500
        Re: Re: 10 sec poll - please reply! Evan Driscoll <driscoll@cs.wisc.edu> - 2012-11-20 19:51 -0600
      Re: 10 sec poll - please reply! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-20 19:01 -0500
      Re: 10 sec poll - please reply! Alan Bawden <alan@scooby-doo.csail.mit.edu> - 2012-11-20 21:15 -0500
    Re: 10 sec poll - please reply! John Gordon <gordon@panix.com> - 2012-11-20 16:09 +0000
      Re: 10 sec poll - please reply! Dave Angel <d@davea.name> - 2012-11-20 11:19 -0500
    Re: 10 sec poll - please reply! emile <emile@fenx.com> - 2012-11-20 08:21 -0800
      Re: 10 sec poll - please reply! mherrmann.at@gmail.com - 2012-11-20 08:29 -0800
        How to use the python to do the unit test "yujian4newsgroup@gmail.com" <yujian4newsgroup@gmail.com> - 2012-11-21 01:40 +0800
        Re: How to use the python to do the unit test emile <emile@fenx.com> - 2012-11-20 09:51 -0800
        Re: 10 sec poll - please reply! xDog Walker <thudfoo@gmail.com> - 2012-11-20 13:33 -0800
        Re: How to use the python to do the unit test Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-11-20 22:02 +0000
      Re: 10 sec poll - please reply! mherrmann.at@gmail.com - 2012-11-20 08:29 -0800
    Re: 10 sec poll - please reply! Tim Chase <python.list@tim.thechases.com> - 2012-11-20 18:00 -0600
      Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 01:17 +0000
        Re: 10 sec poll - please reply! Tim Chase <python.list@tim.thechases.com> - 2012-11-20 19:30 -0600
        Re: 10 sec poll - please reply! Hans Mulder <hansmu@xs4all.nl> - 2012-11-21 13:33 +0100
    Re: 10 sec poll - please reply! rh <richard_hubbe11@lavabit.com> - 2012-11-20 21:25 -0800
    Re: 10 sec poll - please reply! Chris Angelico <rosuav@gmail.com> - 2012-11-21 17:35 +1100
      Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 07:01 +0000
        Re: 10 sec poll - please reply! Andrew Cooper <andrew@nospam.example.com> - 2012-11-21 22:24 +0000
    Re: 10 sec poll - please reply! markus.moldaschl@gmail.com - 2012-11-21 01:29 -0800
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-21 09:19 -0800
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-22 10:00 -0800
      Re: 10 sec poll - please reply! Chris Angelico <rosuav@gmail.com> - 2012-11-23 06:08 +1100
        Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-22 13:45 -0800
        Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-22 13:45 -0800
      Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-23 05:41 +0000
        Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-23 01:08 -0800
          Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-23 08:15 -0800
      Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-23 05:42 -0800
        Re: 10 sec poll - please reply! Kwpolska <kwpolska@gmail.com> - 2012-11-23 17:42 +0100
          Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-23 09:29 -0800
          Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-23 09:29 -0800
        Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-23 22:30 +0000
          Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-24 12:56 -0800
            Re: 10 sec poll - please reply! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-24 18:22 -0500
              Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-25 05:41 -0800
      Re: 10 sec poll - please reply! Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-23 17:10 -0500
        Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-24 13:07 -0800
          Re: 10 sec poll - please reply! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-25 03:56 +0000
            Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-25 05:45 -0800
        Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-24 13:07 -0800
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-24 13:59 -0800
    Re: 10 sec poll - please reply! ALeX inSide <alex.b.inside@gmail.com> - 2012-11-25 04:13 -0800
    Re: 10 sec poll - please reply! Michael Herrmann <michael.herrmann@getautoma.com> - 2012-11-29 03:45 -0800

Page 1 of 4  [1] 2 3 4  Next page →


#33600 — 10 sec poll - please reply!

FromMichael Herrmann <michael.herrmann@getautoma.com>
Date2012-11-20 04:18 -0800
Subject10 sec poll - please reply!
Message-ID<3d71f175-164e-494c-a521-2eaa5679b524@googlegroups.com>
Hi, 

I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type': 

type(ENTER)

type("Hello World!")

type(CTRL + 'a')

What, in your view, would be the most intuitive alternative name?

Here are my thoughts so far: I could call it 'press' but then our GUI automation tool also allows you to click things and then "press" might be mistaken for "pressing a button". A less ambiguous alternative is "type_keys" but that is rather long and doesn't read as well, for instance in type_keys(ENTER).

Thank you very much!

[toc] | [next] | [standalone]


#33601

FromChris Angelico <rosuav@gmail.com>
Date2012-11-20 23:23 +1100
Message-ID<mailman.42.1353414218.29569.python-list@python.org>
In reply to#33600
On Tue, Nov 20, 2012 at 11:18 PM, Michael Herrmann
<michael.herrmann@getautoma.com> wrote:
> Hi,
>
> I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type':
>
> type(ENTER)
>
> type("Hello World!")
>
> type(CTRL + 'a')
>
> What, in your view, would be the most intuitive alternative name?

I've done similar things under names like "send_keys".

ChrisA

[toc] | [prev] | [next] | [standalone]


#33604

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-11-20 13:09 +0000
Message-ID<50ab80f0$0$29987$c3e8da3$5496439d@news.astraweb.com>
In reply to#33600
You know, you would probably get more responses if you picked a 
descriptive subject line that didn't look like spam. I only read your 
post because I accidentally clicked on it.

On Tue, 20 Nov 2012 04:18:38 -0800, Michael Herrmann wrote:

> I'm developing a GUI Automation library (http://www.getautoma.com) and

By the way, your website is down.


> am having difficulty picking a name for the function that simulates key
> strokes. I currently have it as 'type' but that clashes with the
> built-in function. Example uses of 'type':
> 
> type(ENTER)
> type("Hello World!")
> type(CTRL + 'a')
> 
> What, in your view, would be the most intuitive alternative name?


I'd keep the name as "type". It exists in a different namespace to the 
builtin, so people have a choice: they can refer to the fully-qualified 
name, or not, as they prefer. I don't know the name of your module, since 
your website is down, but let's say it's called "automata":

# Option 1
import automata
automata.type("Hello World")


# Option 2
from automata import type
type("Hello World"
import builtins  # in Python 2 use __builtin__ instead
builtins.type([])



So the name clash doesn't matter.



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#33605

FromMichael Herrmann <michael.herrmann@getautoma.com>
Date2012-11-20 05:17 -0800
Message-ID<64db1a8f-4606-4943-b0d0-0f97c1b986fe@googlegroups.com>
In reply to#33600
Hi,

thank you for your replies. So far two people said 'send_keys' and one person said 'type'. 

Steven, thanks for your reply. Sorry if the message title disturbed you. My personal feelings aren't too strongly against 'type' either, but then I'm afraid it might bother more experienced Python programmers who are used to a very different meaning of 'type'. Do you think that could be a problem?

Thanks again to all who have replied,
Michael

On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote:
> Hi, 
> 
> 
> 
> I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type': 
> 
> 
> 
> type(ENTER)
> 
> 
> 
> type("Hello World!")
> 
> 
> 
> type(CTRL + 'a')
> 
> 
> 
> What, in your view, would be the most intuitive alternative name?
> 
> 
> 
> Here are my thoughts so far: I could call it 'press' but then our GUI automation tool also allows you to click things and then "press" might be mistaken for "pressing a button". A less ambiguous alternative is "type_keys" but that is rather long and doesn't read as well, for instance in type_keys(ENTER).
> 
> 
> 
> Thank you very much!

[toc] | [prev] | [next] | [standalone]


#33607

FromMichael Herrmann <michael.herrmann@getautoma.com>
Date2012-11-20 05:20 -0800
Message-ID<79d530d3-e6ce-49da-857c-1b31a9a9f44c@googlegroups.com>
In reply to#33600
P.S.: The website is back online; our hosting provider was having technical problems...

On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote:
> Hi, 
> 
> 
> 
> I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type': 
> 
> 
> 
> type(ENTER)
> 
> 
> 
> type("Hello World!")
> 
> 
> 
> type(CTRL + 'a')
> 
> 
> 
> What, in your view, would be the most intuitive alternative name?
> 
> 
> 
> Here are my thoughts so far: I could call it 'press' but then our GUI automation tool also allows you to click things and then "press" might be mistaken for "pressing a button". A less ambiguous alternative is "type_keys" but that is rather long and doesn't read as well, for instance in type_keys(ENTER).
> 
> 
> 
> Thank you very much!

[toc] | [prev] | [next] | [standalone]


#33610

FromDave Angel <davea@dejaviewphoto.com>
Date2012-11-20 08:39 -0500
Message-ID<mailman.48.1353418804.29569.python-list@python.org>
In reply to#33600
On 11/20/2012 07:18 AM, Michael Herrmann wrote:
> Hi, 
>
> I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type': 
>
> type(ENTER)
>
> type("Hello World!")
>
> type(CTRL + 'a')
>
> What, in your view, would be the most intuitive alternative name?
>
> Here are my thoughts so far: I could call it 'press' but then our GUI automation tool also allows you to click things and then "press" might be mistaken for "pressing a button". A less ambiguous alternative is "type_keys" but that is rather long and doesn't read as well, for instance in type_keys(ENTER).
>
> Thank you very much!

I also vote for send_keys(), even before I saw Chris' reply.

'type' is too overloaded a word.  For example, in Windows, it's the
command to display the contents of a file - it types it to the screen.

[toc] | [prev] | [next] | [standalone]


#33620

FromNeil Cerutti <neilc@norwich.edu>
Date2012-11-20 14:39 +0000
Message-ID<ah1j0lFac8tU2@mid.individual.net>
In reply to#33610
On 2012-11-20, Dave Angel <davea@dejaviewphoto.com> wrote:
> I also vote for send_keys(), even before I saw Chris' reply.
>
> 'type' is too overloaded a word.  For example, in Windows, it's
> the command to display the contents of a file - it types it to
> the screen.

type is a nice verb, but since it's also a well-used noun it's
perhaps not quite as good as send.

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#33626

FromMichael Herrmann <michael.herrmann@getautoma.com>
Date2012-11-20 07:18 -0800
Message-ID<7290a127-97e1-4032-98ae-6e602b87b74b@googlegroups.com>
In reply to#33600
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')

Does that change your preference for 'send_keys'?

Thanks a lot!!!

On Tuesday, November 20, 2012 1:18:38 PM UTC+1, Michael Herrmann wrote:
> Hi, 
> 
> 
> 
> I'm developing a GUI Automation library (http://www.getautoma.com) and am having difficulty picking a name for the function that simulates key strokes. I currently have it as 'type' but that clashes with the built-in function. Example uses of 'type': 
> 
> 
> 
> type(ENTER)
> 
> 
> 
> type("Hello World!")
> 
> 
> 
> type(CTRL + 'a')
> 
> 
> 
> What, in your view, would be the most intuitive alternative name?
> 
> 
> 
> Here are my thoughts so far: I could call it 'press' but then our GUI automation tool also allows you to click things and then "press" might be mistaken for "pressing a button". A less ambiguous alternative is "type_keys" but that is rather long and doesn't read as well, for instance in type_keys(ENTER).
> 
> 
> 
> Thank you very much!

[toc] | [prev] | [next] | [standalone]


#33627

FromMRAB <python@mrabarnett.plus.com>
Date2012-11-20 15:59 +0000
Message-ID<mailman.64.1353427185.29569.python-list@python.org>
In reply to#33626
On 2012-11-20 15:18, 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')
>
> Does that change your preference for 'send_keys'?
>
Calling it "send_keys" does have precedent.

There's a module called SendKeys which uses the SendKeys system call in
Windows. Unfortunately, the last version was for Python 2.6.

When I wanted the functionality for Python 3.3 I had to write my own.

[toc] | [prev] | [next] | [standalone]


#33632

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-11-20 16:21 +0000
Message-ID<50abadf3$0$29987$c3e8da3$5496439d@news.astraweb.com>
In reply to#33626
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.

I believe that your initial instinct for the name of this function was 
correct. It automates typing, so you should call it "type" or (for those 
paranoid about shadowing the built-in, "type_str".



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#33659

FromChris Angelico <rosuav@gmail.com>
Date2012-11-21 07:57 +1100
Message-ID<mailman.95.1353445048.29569.python-list@python.org>
In reply to#33632
On Wed, Nov 21, 2012 at 3:21 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> 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

[toc] | [prev] | [next] | [standalone]


#33666

From"Prasad, Ramit" <ramit.prasad@jpmorgan.com>
Date2012-11-20 21:08 +0000
Message-ID<mailman.101.1353447438.29569.python-list@python.org>
In reply to#33632
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.

simulate_keypress
simulate_key(s)_down
send_kb_press
fake_typing
send_char(s)

> 
> I believe that your initial instinct for the name of this function was
> correct. It automates typing, so you should call it "type" or (for those
> paranoid about shadowing the built-in, "type_str".
> 

I can too easily see somebody doing from module import *  
OR from module import type.


~Ramit



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  

[toc] | [prev] | [next] | [standalone]


#33689

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2012-11-21 01:20 +0000
Message-ID<50ac2c4f$0$29987$c3e8da3$5496439d@news.astraweb.com>
In reply to#33666
On Tue, 20 Nov 2012 21:08:24 +0000, Prasad, Ramit wrote:

>> I believe that your initial instinct for the name of this function was
>> correct. It automates typing, so you should call it "type" or (for
>> those paranoid about shadowing the built-in, "type_str".
>> 
>> 
> I can too easily see somebody doing from module import * OR from module
> import type.

Yes. So what? If they do, then either they intended to do it, or they 
will soon learn not to.

*Accidental* shadowing of names is a bad thing, because you get 
unexpected bugs. *Deliberate* shadowing is not. We're all consenting 
adults here, if somebody calls "from module import type", and shadows the 
builtin type, that's their right to shoot themselves in the foot. Or not, 
as the case may be.


-- 
Steven

[toc] | [prev] | [next] | [standalone]


#33692

FromTim Chase <python.list@tim.thechases.com>
Date2012-11-20 19:39 -0600
Message-ID<mailman.125.1353461891.29569.python-list@python.org>
In reply to#33689
On 11/20/12 19:20, Steven D'Aprano wrote:
> *Accidental* shadowing of names is a bad thing, because you get 
> unexpected bugs. *Deliberate* shadowing is not. We're all
> consenting adults here, if somebody calls "from module import
> type", and shadows the builtin type, that's their right to shoot
> themselves in the foot. Or not, as the case may be.

Python even allows you to unshoot your foot by doing

  from module import type as unshadowed_type

So others can have your poorly-named cake and eat it too. Or some
such confuddling of aphorisms.

-tkc

[toc] | [prev] | [next] | [standalone]


#33635

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2012-11-20 16:31 +0000
Message-ID<mailman.69.1353428995.29569.python-list@python.org>
In reply to#33626
On 20/11/2012 15:18, 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')

In that case I'd just call it keys, that shouldn't cause too much 
confusion :)  Though keys_pressed comes to mind as an alternative.

>
> Does that change your preference for 'send_keys'?
>
> Thanks a lot!!!
>

-- 
Cheers.

Mark Lawrence.

[toc] | [prev] | [next] | [standalone]


#33684

FromAlan Meyer <ameyer2@yahoo.com>
Date2012-11-20 18:46 -0500
Message-ID<50AC163F.9070608@yahoo.com>
In reply to#33626
On 11/20/2012 11:29 AM, mherrmann.at@gmail.com wrote:

 > ... generate_keystrokes?  ...

Not bad.  "gen_keystrokes", or even "keystrokes" might also do.

I suggest using a name that is unique enough that you can grep through 
piles of code and find where it's used.  "type" fails that test. 
"generate_keystrokes" passes with flying colors, but may be overkill.

     Alan

[toc] | [prev] | [next] | [standalone]


#33694

FromEvan Driscoll <driscoll@cs.wisc.edu>
Date2012-11-20 19:51 -0600
Message-ID<mailman.126.1353463682.29569.python-list@python.org>
In reply to#33684
On 11/20/2012 05:46 PM, Alan Meyer wrote:
> On 11/20/2012 11:29 AM, mherrmann.at@gmail.com wrote:
>
> > ... generate_keystrokes?  ...
>
> Not bad.  "gen_keystrokes", or even "keystrokes" might also do.
I would emphatically vote "no" for "keystrokes". That's a noun, not a 
verb. What does it do? Tell you if its parameters are keystrokes?

(gen_keystrokes is fine, though personally I'd probably stick with 
generate_keystrokes of the two.)

Evan

[toc] | [prev] | [next] | [standalone]


#33686

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2012-11-20 19:01 -0500
Message-ID<mailman.119.1353456115.29569.python-list@python.org>
In reply to#33626
On Tue, 20 Nov 2012 07:18:42 -0800 (PST), Michael Herrmann
<michael.herrmann@getautoma.com> declaimed the following in
gmane.comp.python.general:

> 
> Does that change your preference for 'send_keys'?
>

	emit()
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#33695

FromAlan Bawden <alan@scooby-doo.csail.mit.edu>
Date2012-11-20 21:15 -0500
Message-ID<w2d7gpfd7mb.fsf@scooby-doo.csail.mit.edu>
In reply to#33626
Since the event being generated is commonly called a "keystroke", and since
my dictionary defines the noun "stroke" as being: "the act of striking", a
good verb to choose for the action itself would seem to be "strike":

strike('a')

[toc] | [prev] | [next] | [standalone]


#33628

FromJohn Gordon <gordon@panix.com>
Date2012-11-20 16:09 +0000
Message-ID<k8g9ve$n1t$1@reader1.panix.com>
In reply to#33600
In <3d71f175-164e-494c-a521-2eaa5679b524@googlegroups.com> Michael Herrmann <michael.herrmann@getautoma.com> writes:

> What, in your view, would be the most intuitive alternative name?

keyboard_input().

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.python


csiph-web