Trying to run a sudo command from script

Aahz aahz at pythoncraft.com
Wed Jan 13 23:28:37 EST 2010


In article <mailman.330.1262427256.28905.python-list at python.org>,
=?ISO-8859-1?Q?Paul_K=F6lle?=  <paul at subsignal.org> wrote:
>
>If you don't use shell=True you have to provide the full path to 
>commands (and split command and parameters as you do). 

Are you sure?  Try this:

print Popen(['ls'], stdin=PIPE, stdout=PIPE).communicate()[0]
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair



More information about the Python-list mailing list