July 12th, 2013, 02:35 PM
Python opening a program
I am trying to open a program with Python and then extract data.
I got the program to open with os.startfile , but to fully open it, I need to click "ok". Does anyone know the code for clicking the ok button?
July 13th, 2013, 04:39 PM
For assistance, you'll need to explain your question with more detail. I do not know what is os.startfile, and neither does my python installation.
>>> import os
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'startfile'
[/code] are essential for python code and Makefiles!
July 13th, 2013, 07:34 PM
What type of file is it? There may or may not be a "Code for clicking the ok button" depending on what exactly it is you're doing.
Originally Posted by swimgirl320
Is it an executable? Where does the necessity arise to use Python to open it?
(Just some background)
My guess? Win32. You said you didn't help with that stuff. :P
Originally Posted by b49P23TIvg
Remember, os is an OS-specific module. If I understand correctly.
Python 2.7.5 Stackless 3.1b3 060516 (default, May 21 2013, 17:59:42) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import os
Help on built-in function startfile in module nt:
startfile(filepath [, operation]) - Start a file with its associated
When "operation" is not specified or "open", this acts like
double-clicking the file in Explorer, or giving the file name as an
argument to the DOS "start" command: the file is opened with whatever
application (if any) its extension is associated.
When another "operation" is given, it specifies what should be done with
the file. A typical operation is "print".
startfile returns as soon as the associated application is launched.
There is no option to wait for the application to close, and no way
to retrieve the application's exit status.
The filepath is relative to the current directory. If you want to use
an absolute path, make sure the first character is not a slash ("/");
the underlying Win32 ShellExecute function doesn't work if it is.
July 15th, 2013, 08:43 AM
The code is as follows
button = os.startfile('C:\Program Files (x86)\Quorum Business Solutions\PROD\Land Suite - QLS Desktop Application - 6.0\QUpdater.exe')
This code opens the program Quorum, but a part of the opening process is that you have to click ok. I am trying to automate that process so that I can run the code and have the program open and then extract data.