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)
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
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
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
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