1

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!

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

yes, thanks. but one more thing, if i want to run the file i opened, how should i do?
What type of file did you open?
Actually, i can open my scripts now by using your script above, i want to let sofeware run the scripts that was openned. ie, i have some QTP script, i can use your script to open a script i wanted.But i want to know how to use script to let my tool run script that was openned. thanks
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.