Re: Waiting for a subprocess to exit

2009-08-25 Thread Aahz
In article , Miles Kaufmann wrote: > >debacle[1]). Leaving shell=3DFalse makes scripts more secure and =20 >robust; besides, when I'm putting together a command and its =20 >arguments, it's as convenient to build a list (['mycmd', 'myarg']) as =20= > >it is a string (if not more so). unless

Re: Waiting for a subprocess to exit

2009-08-21 Thread Ben Finney
Miles Kaufmann writes: > On Aug 20, 2009, at 10:13 PM, Ben Finney wrote: > > Why would I use ‘os.waitpid’ instead of:: > > > >process = subprocess.Popen("mycmd" + " myarg", shell=True) > >process.wait() > >status = process.returncode > > Really, you can just use: > > process = subpr

Re: Waiting for a subprocess to exit

2009-08-20 Thread Miles Kaufmann
On Aug 20, 2009, at 10:13 PM, Ben Finney wrote: The module documentation has a section on replacing ‘os.system’ , which says to use:: process = subprocess.Popen("mycmd" + " myarg", shell=True) status = os.waitpid(process.pid, 0