replacing batch file with python script

S

SeeBelow

I have not been able to find a simple way to have a python script
execute an MS-DOS program repeatedly. execv(), for example, won't run
it more than once. I have been using many lines of a .bat file, like
so:

..
..
..
del xyz
myexec 1 2
del xyz
myexec 1 2
..
..
..

where myexec is an executable program that I want to run many times. I
would like to replace the repeated batch file lines with a python loop.
There must be an easy way to do that, no? else why is Python called a
scripting language.

Thanks

Mitchell Timin

--
In theory, there is no difference between theory and practice. In
practice, there is.

http://annevolve.sourceforge.net is what I was into until recently. My
interest will revive when someone takes up my "SailChallenge".
Humans may write to me at this address: zenguy at shaw dot ca
 
S

SeeBelow

Sridhar said:
Don't use exec family of functions. Use os.system.

Thanks, that seems to do what I want.

m

--
In theory, there is no difference between theory and practice. In
practice, there is.

http://annevolve.sourceforge.net is what I was into until recently. My
interest will revive when someone takes up my "SailChallenge".
Humans may write to me at this address: zenguy at shaw dot ca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,209
Messages
2,571,089
Members
47,687
Latest member
IngridXxj

Latest Threads

Top