On 3/22/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Titus Brown wrote:
>
> > I could add in a 'system'-alike call easily enough; that was suggested.
> > But I think
> >
> >       returncode = subprocess.call("program")
> >
> > is pretty simple, isn't it?
>
> Something to keep in mind is that system() doesn't
> directly launch a process running the command, it
> uses a shell. So it's not just simple sugar for
> some subprocess.* call.

>>> subprocess.call("ls | grep tmp", shell=True)
svn-commit.2.tmp
svn-commit.tmp

The more important difference is the encoding of the return value:
system() has magic to encode signal-related termination of the child
process.

-Mike
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to