Hi
What i want to do for this is to have my program run in the background simulate pressing a button such as ENTER every 10 seconds or so. I have trauled the net and found solutions for VB and C++ but none for python.

Is this possible in python and if so how would i do it?

Recommended Answers

All 2 Replies

I googled and after some time, I discovered this link: http://www.rutherfurd.net/python/sendkeys/ . If you test it, let us know if it works. I'd like to find an equivalent module on linux.

There is also a perl module named GUITest, which exists with a windows and a linux version. With some work, it could possibly be interfaced with (or transposed to ) python. http://search.cpan.org/search?query=GUITest&mode=all

That first module worked a treat! It is also so simple to use, ill show you a quick demo:

from SendKeys import SendKeys
SendKeys('Hello{SPACE}world{ENTER}')

This still needs some special characters to be put in differently but other then that it is really simple to use, great for running macros.

Thanks Grib :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.