问题描述
我正在尝试使用GUI编写Python脚本,当我按下按钮时,该脚本将执行iMacros脚本.从字面上看,这差不多就够了,经过大量的Google搜索和搜索,我找不到了.我不需要gui或其他任何帮助,我如何才能使iMacros在python函数中运行或由于python函数运行?
I'm trying to write a Python script with a GUI that, when I push a button, will execute a iMacros script. That's literally pretty much it, and after a lot of Googling and searching SO, I can't find it. I don't need help with the gui or anything, just how do I make iMacros run within/because of a python function?
推荐答案
import os
os.system('"C:\Program Files\iOpus\iMacros\iMacros.exe" -macro my_macro.iim')
http://wiki.imacros.net/Example-Batchfile.bat
或
import win32com.client
def Hello():
import win32com.client
w=win32com.client.Dispatch("imacros")
w.iimInit("", 1)
w.iimPlay("Demo\\FillForm")
if __name__=='__main__':
Hello()
http://wiki.imacros.net/Python
另请参阅: http://wiki.imacros.net/Sample_Code
问题在于这些方法将需要imacros的商业或企业版本
( http: //www.iopus.com/imacros/compare/)
The rub is that these methods will require the business or enterprise editions of imacros
( http://www.iopus.com/imacros/compare/)
您可以选择使用Autoit( http://www.autoitscript.com/site/autoit/)来打开Web浏览器的脚本,然后选择一个(imacro)脚本并通过单击播放来运行它,即使在免费版本上,您也可以使用自动安装的python绑定:)
You can alternatly use Autoit ( http://www.autoitscript.com/site/autoit/) to script opening of web browser and selecting a (imacro)script and running it by clicking play and you can use autoits python bindings even on the free version :)
这篇关于将iMacros脚本集成到python中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!