execute bash builtins in python

Nobody nobody at nowhere.com
Wed Mar 17 11:44:34 EDT 2010


On Fri, 12 Mar 2010 08:15:49 -0500, Steve Holden wrote:

> For shell=True I believe you should provide the command as a single
> string, not a list of arguments.

Using shell=True with an argument list is valid.

On Unix, it's seldom what you want: it will invoke /bin/sh to execute the
first argument with $1, $2, ... set from the remaining arguments.

On Windows, a list is converted to a string in the same manner regardless
of the value of the "shell" argument. Specifying shell=True causes the
command string to be executed via "cmd /c ...". This allows the "program"
to be a script, whereas shell=False requires the program to be a binary
executable.




More information about the Python-list mailing list