<div><br></div><div class="gmail_quote">On Wed, Mar 17, 2010 at 11:44 AM, Nobody <span dir="ltr"><<a href="mailto:nobody@nowhere.com">nobody@nowhere.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Fri, 12 Mar 2010 08:15:49 -0500, Steve Holden wrote:<br>
<br>
> For shell=True I believe you should provide the command as a single<br>
> string, not a list of arguments.<br>
<br>
</div>Using shell=True with an argument list is valid.<br>
<br>
On Unix, it's seldom what you want: it will invoke /bin/sh to execute the<br>
first argument with $1, $2, ... set from the remaining arguments.<br>
<br>
On Windows, a list is converted to a string in the same manner regardless<br>
of the value of the "shell" argument. Specifying shell=True causes the<br>
command string to be executed via "cmd /c ...". This allows the "program"<br>
to be a script, whereas shell=False requires the program to be a binary<br>
executable.<br>
<div><div></div><div class="h5"><br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a></div></div></blockquote><div><br></div><div><br></div><div>if you can work interactively, save yourself the headache and just use Ipython:</div>
<div><br></div><div>brucewayne@broo:~$ ipython</div><div>Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) </div><div>Type "copyright", "credits" or "license" for more information.</div><div><br>
</div><div>IPython 0.10 -- An enhanced Interactive Python.</div><div>?         -> Introduction and overview of IPython's features.</div><div>%quickref -> Quick reference.</div><div>help      -> Python's own help system.</div>
<div>object?   -> Details about 'object'. ?object also works, ?? prints more.</div><div><br></div><div>In [1]: alias</div><div>Total number of aliases: 15</div><div>Out[1]: </div><div>[('cat', 'cat'),</div>
<div> ('clear', 'clear'),</div><div> ('less', 'less'),</div><div> ('mkdir', 'mkdir'),</div><div> ('rmdir', 'rmdir'),</div><div> ('cp', 'cp -i'),</div>
<div> ('lc', 'ls -F -o --color'),</div><div> ('ldir', 'ls -F -o --color %l | grep /$'),</div><div> ('lf', 'ls -F -o --color %l | grep ^-'),</div><div> ('lk', 'ls -F -o --color %l | grep ^l'),</div>
<div> ('ll', 'ls -lF'),</div><div> ('ls', 'ls -F'),</div><div> ('lx', 'ls -F -o --color %l | grep ^-..x'),</div><div> ('mv', 'mv -i'),</div><div> ('rm', 'rm -i')]</div>
<div><br></div><div>In [2]:  </div></div><br>