Re: SendKeys and Python 2.7

2010-09-17 Thread Jakson A. Aquino
> On Mon, Sep 13, 2010 at 4:02 PM, Michel Claveau - MVP > wrote: >> Sorry for time, but I am very busy... >> >> With Python + Pywin32, you can force the activation of a window (before >> send some keys...) >> See: >>  win32gui.SetForegroundWindow(w_handle) >> >> or >>  win32gui.SetActiveWindow(w_h

Re: SendKeys and Python 2.7

2010-09-13 Thread Jakson A. Aquino
On Mon, Sep 13, 2010 at 4:02 PM, Michel Claveau - MVP wrote: > Re! > > Sorry for time, but I am very busy... > > > With Python + Pywin32, you can force the activation of a window (before > send some keys...) > See: >  win32gui.SetForegroundWindow(w_handle) > > or >  win32gui.SetActiveWindow(w_hand

Re: SendKeys and Python 2.7

2010-09-13 Thread Michel Claveau - MVP
Re! Sorry for time, but I am very busy... With Python + Pywin32, you can force the activation of a window (before send some keys...) See: win32gui.SetForegroundWindow(w_handle) or win32gui.SetActiveWindow(w_handle) For to find a windows (and his handle), see: win32gui.EnumWindows()

Re: SendKeys and Python 2.7

2010-09-11 Thread Lawrence D'Oliveiro
In message , Jakson A. Aquino wrote: > On Sat, Sep 11, 2010 at 4:25 AM, Lawrence D'Oliveiro > wrote: > >> In message , Jakson >> A. Aquino wrote: >> >>> Your code do send the ^v as expected, but I have problem with the >>> selection of the Windows which will receive the ^v. The code above was >>

Re: SendKeys and Python 2.7

2010-09-11 Thread Jakson A. Aquino
On Fri, Sep 10, 2010 at 10:38 PM, MRAB wrote: > I'd add some more small sleeps to give Windows/R time to act, IYSWIM. I > learned that from experience. :-) I've tried adding sleeps, small and large, but they didn't make much of a difference. Anyway, different machines could require different amou

Re: SendKeys and Python 2.7

2010-09-11 Thread Jakson A. Aquino
On Sat, Sep 11, 2010 at 4:25 AM, Lawrence D'Oliveiro wrote: > In message , Jakson A. > Aquino wrote: > >> Your code do send the ^v as expected, but I have problem with the >> selection of the Windows which will receive the ^v. The code above was OK >> in a Windows XP running inside VirtualBox, but

Re: SendKeys and Python 2.7

2010-09-11 Thread Lawrence D'Oliveiro
In message , Jakson A. Aquino wrote: > Your code do send the ^v as expected, but I have problem with the > selection of the Windows which will receive the ^v. The code above was OK > in a Windows XP running inside VirtualBox, but when tested in a real > machine, it proved to be highly inconsisten

Re: SendKeys and Python 2.7

2010-09-11 Thread Lawrence D'Oliveiro
In message , Jakson A. Aquino wrote: > On Fri, Sep 10, 2010 at 7:19 PM, Lawrence D'Oliveiro > wrote: > >> In message , Jakson >> A. Aquino wrote: >> >>> On Fri, Sep 10, 2010 at 6:26 AM, Lawrence D'Oliveiro >>> wrote: >> In message , Jakson A. Aquino wrote: > I would like to s

Re: SendKeys and Python 2.7

2010-09-10 Thread MRAB
On 11/09/2010 01:45, Jakson A. Aquino wrote: On Thu, Sep 9, 2010 at 8:24 PM, Jakson A. Aquino wrote: On Thu, Sep 9, 2010 at 5:40 PM, Michel Claveau - MVP wrote: Hi! Example for send ^V (with PyWin32): import time,win32api,win32con win32api.keybd_event(win32con.VK_CONTROL, 0, 0, 0) w

Re: SendKeys and Python 2.7

2010-09-10 Thread Jakson A. Aquino
On Thu, Sep 9, 2010 at 8:24 PM, Jakson A. Aquino wrote: > On Thu, Sep 9, 2010 at 5:40 PM, Michel Claveau - MVP > wrote: >> Hi! >> >> Example for send ^V  (with PyWin32): >> >>  import time,win32api,win32con >>  win32api.keybd_event(win32con.VK_CONTROL, 0, 0, 0) >>  win32api.keybd_event(ord('V'),

Re: SendKeys and Python 2.7

2010-09-10 Thread Jakson A. Aquino
On Fri, Sep 10, 2010 at 7:19 PM, Lawrence D'Oliveiro wrote: > In message , Jakson A. > Aquino wrote: >> On Fri, Sep 10, 2010 at 6:26 AM, Lawrence D'Oliveiro >> wrote: >>> In message , Jakson >>> A. Aquino wrote: I would like to send code from Vim [1] to R [2] on Microsoft Windows. >>> >>> Wh

Re: SendKeys and Python 2.7

2010-09-10 Thread Lawrence D'Oliveiro
In message , Jakson A. Aquino wrote: > On Fri, Sep 10, 2010 at 6:26 AM, Lawrence D'Oliveiro > wrote: > >> In message , Jakson >> A. Aquino wrote: >> >>> I would like to send code from Vim [1] to R [2] on Microsoft Windows. >> >> Why such a roundabout way? Why not just run R in a subprocess and f

Re: SendKeys and Python 2.7

2010-09-10 Thread Jakson A. Aquino
On Fri, Sep 10, 2010 at 6:26 AM, Lawrence D'Oliveiro wrote: > In message , Jakson A. > Aquino wrote: > >> I would like to send code from Vim [1] to R [2] on Microsoft Windows. > > Why such a roundabout way? Why not just run R in a subprocess and feed it a > script to run? Emacs with ESS runs R in

Re: SendKeys and Python 2.7

2010-09-10 Thread Lawrence D'Oliveiro
In message , Jakson A. Aquino wrote: > I would like to send code from Vim [1] to R [2] on Microsoft Windows. Why such a roundabout way? Why not just run R in a subprocess and feed it a script to run? > [1] http://www.vim.org/ > [2] http://www.r-project.org/ -- http://mail.python.org/mailman/

Re: SendKeys and Python 2.7

2010-09-09 Thread Jakson A. Aquino
On Thu, Sep 9, 2010 at 5:40 PM, Michel Claveau - MVP wrote: > Hi! > > Example for send ^V  (with PyWin32): > >  import time,win32api,win32con >  win32api.keybd_event(win32con.VK_CONTROL, 0, 0, 0) >  win32api.keybd_event(ord('V'), 0, win32con.KEYEVENTF_EXTENDEDKEY | 0, 0) >  time.sleep(0.05) >  win

Re: SendKeys and Python 2.7

2010-09-09 Thread Michel Claveau - MVP
Hi! Example for send ^V (with PyWin32): import time,win32api,win32con win32api.keybd_event(win32con.VK_CONTROL, 0, 0, 0) win32api.keybd_event(ord('V'), 0, win32con.KEYEVENTF_EXTENDEDKEY | 0, 0) time.sleep(0.05) win32api.keybd_event(ord('V'), 0, win32con.KEYEVENTF_EXTENDEDKEY | win32c

Re: SendKeys and Python 2.7

2010-09-09 Thread Albert Hopkins
On Thu, 2010-09-09 at 07:07 -0300, Jakson A. Aquino wrote: > Vim needs python 2.7 >From where do you base this assertion? I have been using vim 7.3 (with embedded python) with python 2.6 pretty much since it has been released. :version VIM - Vi IMproved 7.3 (2010 Aug 15, compiled

SendKeys and Python 2.7

2010-09-09 Thread Jakson A. Aquino
Hi, I would like to send code from Vim [1] to R [2] on Microsoft Windows. Vim needs python 2.7 but the pre-compiled SendKeys module [3] is only avaiable for python 2.6. How can I make SendKeys work with python 2.7? I don't know how to compile python code. Is there an alternative to SendKeys? I'm