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 !:)

Edited 4 Years Ago by TF401: n/a

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...

Edited 4 Years Ago by TF401: n/a

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

This article has been dead for over six months. Start a new discussion instead.