sendKey

Steve McKay smmckay at broncs.utpa.edu
Mon Jun 9 05:31:17 CEST 2008


Gandalf wrote:
> I found some script that send keys , But I couldn't  manage to send
> CTRL+c with none of them
> 
> can any one tell me what i'm doing wrong:
> 
> import win32api
> import win32com.client
> 
> shell = win32com.client.Dispatch("WScript.Shell")
> shell.Run("Notepad")
> win32api.Sleep(100)
> shell.AppActivate("Notepad")
> win32api.Sleep(100)
> shell.SendKeys("112435435")
> win32api.Sleep(100)
> 
> shell.SendKeys("^a") # that wouldn't select all
> win32api.Sleep(100)
> shell.SendKeys("^c")# that wouldn't copy
> 
> 
> 
> 
> import SendKeys
> SendKeys.SendKeys("""^c""")
> 
> 
> Thank you!
> 
Your code didn't work for me, either. But shell.SendKeys("^a^c") 
works...go figure.



More information about the Python-list mailing list