954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Is this automation possible in PYTHON ?

Hi,
I want to know if is possible to make those events/automation with a Python code( without any program like Pywinauto ), so I could compile the python code:


1. sending keys to an active window;
2. sending mouse clicks to specific coordinates in a window;
3. set the window to be everytime active or on top;
4. waiting/sleeping ( for lowering CPU consumption ) until a specific window exists;

If this could be accomplished with Python ,can anymoe show me how to do this,or a tutorial, please?
Thankyou !:)

TF401
Newbie Poster
5 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

Why don't you want to use existing programs ? It simply means rewriting these programs in your own code.

Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 
Why don't you want to use existing programs ? It simply means rewriting these programs in your own code.

I just need to code something that would do that automation, without a GUI or user interaction and at the final, to compile it. Just like autoit, code the events and after that I can compile the script, but now I use python...

TF401
Newbie Poster
5 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
 

I would look into SendKeys

Here
or
Here

The code is pretty straightforward

from win32com.client import Dispatch
SendKeys = Dispatch("WScript.Shell").SendKeys

# then to actually send a key

SendKeys('a')


Here is an answer related to getting the title of currently opened windows: here

ihatehippies
Junior Poster
190 posts since Oct 2008
Reputation Points: 33
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: