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-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 Wind

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

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 li

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 t

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

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