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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It is easiest if you use the SendKeys package. You can find a Windows installer for various Python versions here.
The simplest use case, sending plain text, is very simple:
You can do all sorts of nifty things using key-codes to represent for unprintable characters:
Read the documentation for full details.
If for whatever reason you don’t want to introduce a dependency on a non-standard library package, you can do the same thing using COM: