Colin
Colin

Reputation: 85

How to start an application using Python

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!

Upvotes: 1

Views: 2446

Answers (2)

Fábio Diniz
Fábio Diniz

Reputation: 10353

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

Upvotes: 0

eWizardII
eWizardII

Reputation: 1936

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

Upvotes: 1

Related Questions