Re: calling python scripts as a sub-process

2008-11-19 Thread Catherine Moroney
Dan Upton wrote: On Wed, Nov 19, 2008 at 2:38 PM, Catherine Moroney <[EMAIL PROTECTED]> wrote: Dan Upton wrote: On Wed, Nov 19, 2008 at 2:13 PM, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: The command (stored as an array of strings) that

Re: calling python scripts as a sub-process

2008-11-19 Thread Jeremy Sanders
Dan Upton wrote: > I think when I came across this error, I added shell=True, e.g. > > sub1 = subprocess.Popen(command, shell=True) That's really papering over the bug. You need to have the parameters separately, including the name of the program, separately in the list. You need to remove any s

Re: calling python scripts as a sub-process

2008-11-19 Thread Jeremy Sanders
Catherine Moroney wrote: > I have one script (Match1) that calls a Fortran executable as a > sub-process, and I want to write another script (Match4) that > spawns off several instances of Match1 in parallel and then waits > until they all finish running. The only way I can think of doing this >

Re: calling python scripts as a sub-process

2008-11-19 Thread Dan Upton
On Wed, Nov 19, 2008 at 2:38 PM, Catherine Moroney <[EMAIL PROTECTED]> wrote: > Dan Upton wrote: >> >> On Wed, Nov 19, 2008 at 2:13 PM, Philip Semanchuk <[EMAIL PROTECTED]> >> wrote: >>> >>> On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: >>> The command (stored as an array of strings) t

Re: calling python scripts as a sub-process

2008-11-19 Thread Catherine Moroney
Dan Upton wrote: On Wed, Nov 19, 2008 at 2:13 PM, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: The command (stored as an array of strings) that I'm executing is: ['python ../src_python/Match1.py ', '--file_ref=MISR_AM1_GRP_ELLIPSOID_GM_P228

Re: calling python scripts as a sub-process

2008-11-19 Thread Catherine Moroney
I just tried that, and I get the same error. Interestingly enough, a shorter (and incorrect) version of the command works well enough so that it gets into the Match1 code and does the argument check there. The following code gets into Match1: >>> command = ['python', '../src_python/Match1.py','

Re: calling python scripts as a sub-process

2008-11-19 Thread Mike Driscoll
On Nov 19, 1:03 pm, Catherine Moroney <[EMAIL PROTECTED]> wrote: > I have one script (Match1) that calls a Fortran executable as a > sub-process, and I want to write another script (Match4) that > spawns off several instances of Match1 in parallel and then waits > until they all finish running.  Th

Re: calling python scripts as a sub-process

2008-11-19 Thread Dan Upton
On Wed, Nov 19, 2008 at 2:13 PM, Philip Semanchuk <[EMAIL PROTECTED]> wrote: > > On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: > >> The command (stored as an array of strings) that I'm executing is: >> >> ['python ../src_python/Match1.py ', >> '--file_ref=MISR_AM1_GRP_ELLIPSOID_GM_P228_O003

Re: calling python scripts as a sub-process

2008-11-19 Thread Philip Semanchuk
On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: The command (stored as an array of strings) that I'm executing is: ['python ../src_python/Match1.py ', '-- file_ref=MISR_AM1_GRP_ELLIPSOID_GM_P228_O003571_BF_F03_0024.hdf ', '--file_cmp=MISR_AM1_GRP_ELLIPSOID_GM_P228_O003571_DF_F03_0024.

calling python scripts as a sub-process

2008-11-19 Thread Catherine Moroney
I have one script (Match1) that calls a Fortran executable as a sub-process, and I want to write another script (Match4) that spawns off several instances of Match1 in parallel and then waits until they all finish running. The only way I can think of doing this is to call it as a sub-process, ra