Python code to automate desktop activities in windows

stallion picture stallion · Aug 6, 2012 · Viewed 65.1k times · Source

I want to automate desktop activities in Windows environment using Python. How it can be done? Some examples will also be helpful.

By desktop activities, I mean actions such as taking control over mouse and keyboard, access active windows properties, double-click on an icon on the desktop, minimize and maximize windows, enter data to an input popup window through keyboard, etc.

Answer

sloth picture sloth · Aug 6, 2012

Have a look at SIKULI.

Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots).

SIKULI uses a very clever combination of taking screenshots, and embedding them into your python (it's jython, actually) script.


Take screenshots:

enter image description here

and use them in your code:

enter image description here