On 10/28/05, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > >>> f = os.popen2('ping 192.168.8.85 -c 100 > cap1.txt')
> > >>> f[0].write('\x03')
> >
> > Thank command works, but 'f[1]' is in read-only mode and I can't write
> > to it.
> > My command in the background is still not terminated.
>
> Thats almost certainly because ping never reads its input.
> In that case you'll need to send a kill signal to the process and
> to do that you need to find the process ID. I'm not sure if
> popen() provides access to the PID but if not you could
> either search for it (this might be too slow) or just drop
> down to use fork rather than popen, as fork will return
> the PID.Would calling PS via another popen() and using string methods to get the Pid work? I'm rather new to Linux & Python... Regards, Liam Clarke _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
