I want to use a Python script to start an application, and then click File to Open a file. How should accomplish开发者_运维问答 this? For example, I want to write a script which starts an automation tool/program that I have.
Is there another scripting language that is better suited for this?
You are appreciated!
If I understand your question correctly you basically want to load a program using python, if so you should try something like this:
import os
ACRORD = r"c:\Program Files\Adobe\Acrobat 5.0\Reader\acrord32.exe"
os.system ('"%s" %s' % (ACRORD, r"c:\temp\blah.pdf"))
as found here also: http://mail.python.org/pipermail/python-win32/2004-April/001868.html
If you have to use a pure python solution you can explore PyMouse, but you should really take a look at Xdotool, which is a software made specifically for automation tasks
精彩评论