We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
如何在 python 中使用 AutoItX COM/DLL
在 Python 中使用 AutoIt 有两种方法:
pyautoit 模块将使用 DLL,而我们可以使用 pywin32 COM。据我所知,两者在功能上没有区别。
先决条件
并非所有 AutoIt 功能都可以通过 COM/DLL 接口使用。要查看哪些函数,请参阅 AutoItX 上的帮助文件。
Pyautoit
通过 pip 或您首选的方法安装
:如果在安装 pyautoit 时出现错误:
WindowsError: [Error 193] %1 is not a valid Win32 application
,请使用 32 位版本的 python。我无法使用 64 位版本的 python 安装 pyautoit。当然,您的里程可能会有所不同。导入和使用:
autoit 命令都使用 lower_case_with_underscores,而不是 AutoItX 首选的 CamelCase。因此,ControlSend 变为 control_send,WinClose 变为 win_close,等等。
Pywin32
安装 pywin32 后,通过以下方式调用 AutoItX 函数:
如果您在使用此版本时遇到问题,请将所有内容安装为 32 位,然后重试。
How to use AutoItX COM/DLL in python
There are two methods for using AutoIt in Python:
The pyautoit module will make use of the DLL while with pywin32 we can use the COM. As far as I know, there is no functional difference between the two.
Prerequisites
Not all AutoIt functions are available through the COM/DLL interface. To see which functions are, see the help file on AutoItX.
Pyautoit
Install via pip or your preferred method:
If you get an error:
WindowsError: [Error 193] %1 is not a valid Win32 application
when installing pyautoit, use the 32 bit version of python. I haven't been able to get pyautoit to install using the 64 bit version of python. Of course, your mileage may vary.Import and use:
The autoit commands all use lower_case_with_underscores rather than AutoItX's preferred CamelCase. Thus ControlSend becomes control_send, WinClose becomes win_close, etc.
Pywin32
Once pywin32 is installed, call AutoItX functions by:
If you have trouble with this version, install everything as 32 bit and try again.
AutoItX.dll
和AutoItX3_x64.dll
包含在默认安装中,位于名为“AutoItX”的目录中。查看该目录中的帮助文件AutoItX.chm
以获取更多信息。AutoItX.dll
andAutoItX3_x64.dll
are included in the default installation, in a directory called "AutoItX". Check out the help fileAutoItX.chm
in that directory for more info.