By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,510 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,510 IT Pros & Developers. It's quick & easy.

Can this be done in py?

P: n/a
Now, don't get me wrong if this is a trivial question, or even an
apsurd one. I'm new to python, so my mileage may vary.

I have several exe files, console applications that pretty much run on
the principle:
<startingfirst.exe
Enter file name: start.dat
<outputs filename.dat<end of first.exe>

<startingsecond.exe
Enter file name: filename.dat
<output result.dat<end of second.exe>

.... you get the point.

These are old exe programs, not mine (I can't recompile them or modify
them in any way), but which work fine and I still regularly use them.
However, I would like to automate this process (since they are not
just two, and since this process of entering always the same data is
tiresome.

Is there a way this could be done with a python script ?
A script which starts the .exe file, enters some predefined data,
waits for an exe to finish, then again, starts the second .exe file,
.... ?

I would appreaciate any input you can give on this problem.

--
Bob
Nov 7 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
2008/11/7 Robert Singer <rsinger@____.com>:
Now, don't get me wrong if this is a trivial question, or even an
apsurd one. I'm new to python, so my mileage may vary.

I have several exe files, console applications that pretty much run on
the principle:
<startingfirst.exe
Enter file name: start.dat
<outputs filename.dat<end of first.exe>

<startingsecond.exe
Enter file name: filename.dat
<output result.dat<end of second.exe>

... you get the point.

These are old exe programs, not mine (I can't recompile them or modify
them in any way), but which work fine and I still regularly use them.
However, I would like to automate this process (since they are not
just two, and since this process of entering always the same data is
tiresome.

Is there a way this could be done with a python script ?
A script which starts the .exe file, enters some predefined data,
waits for an exe to finish, then again, starts the second .exe file,
... ?
Of course. See the subprocess module for this.

Mathieu
Nov 7 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.