Python & Linux, some questions (2)

Simon Burton simonb at NOTTHISBIT.webone.com.au
Tue Mar 16 06:11:30 EST 2004


On Mon, 15 Mar 2004 20:45:53 -0700, Hamilcar Barca wrote:

> In article <c353om$23bqmc$1 at ID-99001.news.uni-berlin.de> (Mon, 15 Mar 2004
> 21:28:47 +0100), Luca T. wrote:
> 
>> r,w,e = popen2.popen3('su -c ls')
>> 
>> So it seems that "su" refuses to work if it is run like this.
> 
> su needs the user's password and it insists on reading it from a tty
> because it can control echoing.

Maybe pexpect can help you here. It works great on linux.

Simon.




More information about the Python-list mailing list