赞
踩
Python版本AutoIT,直接绑定到 AutoItX3.dll,然后就可以使用AutoIT的功能了。
pip install -U pyautoit
运行记事本,然后写入“hello world”,最后不保存关闭。
import autoit
autoit.run("notepad.exe")
autoit.win_wait_active("[CLASS:Notepad]", 3)
autoit.control_send("[CLASS:Notepad]", "Edit1", "hello world{!}")
autoit.win_close("[CLASS:Notepad]")
autoit.control_click("[Class:#32770]", "Button2")
类似于注册AutoIT,然后调用的方法:
1、安装pywin32
pip install pywin32
2、从autoit3\AutoItX下找到AutoItX3_x64.dll AutoitX.dll,选择对应的32位/64位版本
3、注册dll文件(注意用管理员身份调用cmd)。
regsvr32 AutoItX3_x64.dll 或regsvr32 AutoitX.dll
4、调用
import win32com.client
autoit = win32com.client.Dispatch("AutoItX3.Control")
autoit.Run("NotePad.exe")
https://pypi.org/project/PyAutoIt/
https://github.com/jacexh/pyautoit
https://github.com/mhammond/pywin32
https://blog.csdn.net/sophia_slr/article/details/41847999
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。