That's actually a good idea and in this case probably the only way that
this would work. I can auto-generate the batch file from the python
script with the parameters that I need and just execute that with the
subprocess.
I wish there was a cleaner was as well.
If using a command shell processor on Windows (shell = True), you
might try passing as the command line
wrenv.exe && make clean
{a single & might work too -- if I understand the documentation, the &&
says to only run the second command IF the first did not return a
failure code}
C:\Documents and Settings\Dennis Lee Bieber>date /t && time /t
Sat 04/24/2010
12:26 PM
C:\Documents and Settings\Dennis Lee Bieber>data /t && time /t
'data' is not recognized as an internal or external command,
operable program or batch file.
C:\Documents and Settings\Dennis Lee Bieber>data /t & time /t
'data' is not recognized as an internal or external command,
operable program or batch file.
12:32 PM
Valid command string('Sat 04/24/2010 \r\n12:34 PM\r\n', '')
Second command bad('Sat 04/24/2010 \r\n', "'tim' is not recognized as an internal or
external command,\r\noperable program or batch file.\r\n")
First command bad, using &&; second command did not run('', "'dat' is not recognized as an internal or external
command,\r\noperable program or batch file.\r\n")
First command bad, using &; second command DID run('12:35 PM\r\n', "'dat' is not recognized as an internal or external
command,\r\noperable program or batch file.\r\n")
Without the shellTraceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "e:\Python25\lib\subprocess.py", line 594, in __init__
errread, errwrite)
File "e:\Python25\lib\subprocess.py", line 816, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified