How to run an EXE, with argument, capture output value

Tim Harig usernet at ilthio.net
Thu Nov 18 18:16:05 EST 2010


On 2010-11-18, noydb <noydb00 at gmail.com> wrote:
> On Nov 18, 5:22 pm, Tim Harig <user... at ilthio.net> wrote:
>> On 2010-11-18, noydb <jenn.du... at gmail.com> wrote:
> Okay, I see now.  I did run it to start with 0 -- still same result no
> matter if 0 or -1.
> So, what is result (stdout, using [0]) in this case?  (yes, i know I
> sound dumb - programming is not my background, obviously).  A list,

Nope, this one is my fault, I never should have posted being so tired.  I
was reading posts after being unable to sleep and missed something
important about what you said.  Sorry about the confusion.

> tuple???  How do you access stdout (or is it stdoutdata?) results?  I
> have tried, get errors with all attempts.  The exe gui returns several

GUI!!!!  Ewwwww.  I missed that part.  GUIs, on Windows, do not have the
standard streams.  GUIs are in general, ugly to automate through the GUI
itself.  I would be much better if the program can be run with command line
options, text interface, or if provides an automation object through COM or
.Net.

As workaround, if you run Python through Windows Script Host, you can open
the program with WshShell and automate it, by sending it the keystrokes as
you perform the action by typing, with SendKeys()



More information about the Python-list mailing list