In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
[ someone's command that fails, run in popen ]
> > cmd.read()
> >
> > This returns output of "".
...
> > I'm not sure what I'm doing wrong here.
> >
> Probably expecting sudo to read the standard input for its password.
Al
Steve Holden wrote:
>>
> Probably expecting sudo to read the standard input for its password.
>
> First of all, sudo doesn't always ask for your password. Secondly, when
> it does I'm pretty sure it will take care to try and do it on the
> controlling tty, not by reading stdin.
>
sudo wasn't th
Kevin Walzer wrote:
> I'm trying to structure a Python script that streams output over a pipe.
>
> Here is my code:
>
> import os
>
> cmd = os.popen('echo foo | sudo -S /usr/sbin/tcpdump -en1')
> cmd.read()
>
> This returns output of "". I'm expecting the standard output of "tcpdump
> -en1". Ho
I'm trying to structure a Python script that streams output over a pipe.
Here is my code:
import os
cmd = os.popen('echo foo | sudo -S /usr/sbin/tcpdump -en1')
cmd.read()
This returns output of "". I'm expecting the standard output of "tcpdump
-en1". How does one read unbuffered output over a p