在 Windows 中自动化桌面活动的 Python 代码 [英] Python code to automate desktop activities in windows
问题描述
我想使用 Python 在 Windows 环境中自动化桌面活动.怎么做?一些示例也会有所帮助.
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.
推荐答案
看看 SIKULI.
Sikuli 是一种自动化和测试图形用户的视觉技术使用图像(屏幕截图)的界面(GUI).
Sikuli is a visual technology to automate and test graphical user interfaces (GUI) using images (screenshots).
SIKULI 使用非常巧妙的组合截取屏幕截图,并将它们嵌入到您的 Python 中(它是 jython,实际上) 脚本.
SIKULI uses a very clever combination of taking screenshots, and embedding them into your python (it's jython, actually) script.
截取屏幕截图:
并在您的代码中使用它们:
and use them in your code:
这篇关于在 Windows 中自动化桌面活动的 Python 代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!