Michael Williams wrote:

> I've recently seen the "subprocess" module and am rather confused by
> it's requirements.  Is it not possible to execute an entire string
> without having to break them up into a list of arguments?  For
> instance, I'd much rather do the following:
> 
> 
> subprocess.call("ls -al | grep -i test")

Try

subprocess.call("ls -al | grep -i test", shell=True)

> 
> 
> . . .than to have to:
> 
> 
> list = ["ls", "-a", "-l" ]  . . . . . . and so on and so forth.
> subprocess.call(list. . .)

which avoids a lot of problems with shell quoting.

Peter


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to