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

Recommended Answers

All 3 Replies

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

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

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

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.