3

Possible Duplicate:
How do I copy a string to the clipboard on Windows using Python?

Can someone make me an example or explain to me how can I paste something to the active window with Python?

I've edited because I didn't know that paste to the clipboard doesnt paste to the active window...

Community
  • 1
  • 1
Bruno 'Shady'
  • 4,348
  • 13
  • 55
  • 73
  • Duplicate. see: - Windows: https://stackoverflow.com/questions/579687/how-do-i-copy-a-string-to-the-clipboard-on-windows-using-python - Mac: https://stackoverflow.com/questions/1825692/can-python-send-text-to-the-mac-clipboard - Linux: http://www.answermysearches.com/python-how-to-copy-and-paste-to-the-clipboard-in-linux/286/ – Jeriko Jun 15 '10 at 19:25

1 Answers1

3

since you haven't accepted the duplicate as an answer may i suggest:

import win32com.client
shell = win32com.client.Dispatch("WScript.Shell")
shell.SendKeys('keys to send to active window...')

from:

here

and if you need to find out about keys like Backspace go to

here

jma
  • 798
  • 1
  • 10
  • 17