Re: Trying to run a sudo command from script

2010-01-13 Thread Aahz
In article , =?ISO-8859-1?Q?Paul_K=F6lle?= 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 (a...@pythoncraft.com)

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 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 = subp

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.Pop

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(), stdin=subpr

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) proc.communicate(inp