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

2010-11-19 Thread noydb
Thanks to Jerry Hill above who helped. This worked: from pywinauto.application import Application app = Application() app.start_(r'C:\temp\hallbig2.exe') app.Form1.Edit6.TypeKeys(r'C:\temp\input\Ea39j.txt') E_Value = "" while (E_Value == ""): app.Form1.Compute.Click() E_Value = app.Form1.E

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

2010-11-19 Thread Tim Harig
C:\Documents and Settings\Tim Harig\My Documents\autoCalc>dir Volume in drive C has no label. Volume Serial Number is 30D9-35E0 Directory of C:\Documents and Settings\Tim Harig\My Documents\autoCalc 11/19/2010 12:20 PM . 11/19/2010 12:20 PM .. 11/19/2010 12:19 PM

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

2010-11-19 Thread Jerry Hill
On Fri, Nov 19, 2010 at 9:52 AM, noydb wrote: > Any other help?  I am guessing not, just wanted to try one more time. > Could really use help, please!! You'll need to give us more information about the program you're trying to automate. It originally sounded like you just needed to run a console

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

2010-11-19 Thread noydb
Any other help? I am guessing not, just wanted to try one more time. Could really use help, please!! -- http://mail.python.org/mailman/listinfo/python-list

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

2010-11-18 Thread noydb
On Nov 18, 6:20 pm, noydb wrote: > On Nov 18, 5:54 pm, noydb wrote: > > > > > > > On Nov 18, 5:22 pm, Tim Harig wrote: > > > > On 2010-11-18, noydb wrote: > > > > > import subprocess > > > > pig = subprocess.Popen(["C:\Halls\hallbig2.exe"], > > > > stdin=subprocess.PIPE, stdout=subprocess.PIPE)

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

2010-11-18 Thread noydb
On Nov 18, 5:54 pm, noydb wrote: > On Nov 18, 5:22 pm, Tim Harig wrote: > > > > > > > On 2010-11-18, noydb wrote: > > > > import subprocess > > > pig = subprocess.Popen(["C:\Halls\hallbig2.exe"], > > > stdin=subprocess.PIPE, stdout=subprocess.PIPE) > > > result = pig.communicate(input='C:\Halls\

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

2010-11-18 Thread Tim Harig
On 2010-11-18, noydb wrote: > On Nov 18, 5:22 pm, Tim Harig wrote: >> On 2010-11-18, noydb 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

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

2010-11-18 Thread noydb
On Nov 18, 5:22 pm, Tim Harig wrote: > On 2010-11-18, noydb wrote: > > > import subprocess > > pig = subprocess.Popen(["C:\Halls\hallbig2.exe"], > > stdin=subprocess.PIPE, stdout=subprocess.PIPE) > > result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need > > to capture the, what I

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

2010-11-18 Thread Tim Harig
On 2010-11-18, Jean-Michel Pichavant wrote: > Tim Harig wrote: >> If you are not already, I would highly suggest using Python3 with the >> subprocess module: > Suggesting subprocess is a good idea, *highly* suggesting python3 is

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

2010-11-18 Thread Tim Harig
On 2010-11-18, noydb wrote: > import subprocess > pig = subprocess.Popen(["C:\Halls\hallbig2.exe"], > stdin=subprocess.PIPE, stdout=subprocess.PIPE) > result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need > to capture the, what I think is the, last output >From the subprocess doc

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

2010-11-18 Thread noydb
I will use 2.5. I tried your suggestion, with this code import subprocess pig = subprocess.Popen(["C:\Halls\hallbig2.exe"], stdin=subprocess.PIPE, stdout=subprocess.PIPE) result = pig.communicate(input='C:\Halls\Input\Ea39j.txt')[-1] #I need to capture the, what I think is the, last output print

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

2010-11-18 Thread Jean-Michel Pichavant
Tim Harig wrote: On 2010-11-18, noydb wrote: I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several output values, one of which I want to capture into a variable. Can I use P

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

2010-11-17 Thread Tim Harig
On 2010-11-18, Tim Harig wrote: > On 2010-11-18, noydb wrote: >> I have an executable that I want to run within python code. The exe >> requires an input text file, the user to click a 'compute' button, and >> then the exe calculates several output values, one of which I want to >> capture into

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

2010-11-17 Thread Tim Harig
On 2010-11-18, noydb wrote: > I have an executable that I want to run within python code. The exe > requires an input text file, the user to click a 'compute' button, and > then the exe calculates several output values, one of which I want to > capture into a variable. Can I use Python to supply

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

2010-11-17 Thread noydb
Hello All, I would appreciate some guidance on this. I'm a newbe, sorry if I sound dumb - I kind of am on this stuff! I have an executable that I want to run within python code. The exe requires an input text file, the user to click a 'compute' button, and then the exe calculates several output