Re: Trying to run a sudo command from script

2010-01-13 Thread Aahz
In article mailman.330.1262427256.28905.python-l...@python.org, =?ISO-8859-1?Q?Paul_K=F6lle?= p...@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'],

Re: Trying to run a sudo command from script

2010-01-03 Thread Kent Tenney
On Fri, Jan 1, 2010 at 5:08 PM, Diez B. Roggisch de...@nospam.web.de wrote: Kent Tenney schrieb: Howdy, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc =

Re: Trying to run a sudo command from script

2010-01-02 Thread Paul Kölle
Am 01.01.2010 23:55, schrieb Kent Tenney: Howdy, Hi Kent, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc = subprocess.Popen('sudo touch /etc/foo'.split(),

Re: Trying to run a sudo command from script

2010-01-02 Thread Steve Holden
Paul Kölle wrote: Am 01.01.2010 23:55, schrieb Kent Tenney: Howdy, Hi Kent, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc = subprocess.Popen('sudo touch

Trying to run a sudo command from script

2010-01-01 Thread Kent Tenney
Howdy, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE) proc.communicate(input=pw) getting

Re: Trying to run a sudo command from script

2010-01-01 Thread Diez B. Roggisch
Kent Tenney schrieb: Howdy, A script running as a regular user sometimes wants to run sudo commands. It gets the password with getpass. pw = getpass.getpass() I've fiddled a bunch with stuff like proc = subprocess.Popen('sudo touch /etc/foo'.split(), stdin=subprocess.PIPE)