Using Python to control the graphical interface of other programs?

I have a program in which there is an input field and a button.

I want python to type a string in an input field, then click a button. What is the best way to get around this?

This is for Windows 7, BTW.

+3
source share
3 answers

pyWinAuto will work well for this. With it, you can "type" text into windows based on the window title (or window class), as well as the "click" buttons. It is pretty easy to use, and the site is very good at giving you examples of how to do what you want.

http://pywinauto.openqa.org/howto.html

+3
source

I heard, but have not tried myself:

+1

PyAutoGUI (installed via pip) can automate the mouse / keyboard and runs on Mac / Windows / Linux.

It also has some basic image recognition capabilities in screenshots, such as Sikuli.

https://pypi.python.org/pypi/PyAutoGUI

0
source

Source: https://habr.com/ru/post/1761223/


All Articles