0

All,
I am using a python script (v2.0) to call a batch file.

1. The python script should wait until the batch file is finished. (So that rules out os.startfile, os.popen etc.)
2. For unknown reason, os.system does not work ...

So I am using os.spawnv(os.P_WAIT,BatchFile, BatchFile)
where Batchfile =r"E:\..... \*.bat"

Now the problem I have is ....
I WANT TO PASS 3 ARGUMENTS TO THE BATCH FILE.
Can somebody help me? (PS.Urgent)

Advance thanks...


PS. Using os.putenv("VARNAME", value) in python and then using
%VARNAME% in batch file is not good enough... :( as I have multiple python scripts calling a batch file each simultaneously - and each have 3 variables (same varname, but different values) to pass.

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by woooee
0

Run an external program from within Python code with
subprocess.call(["program-name", "arg1", "arg2"])
rather than os.system("program-name arg1 arg2"),
since os.system() does not allow the Python program
to run in the background, whereas subprocess does.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.