I don't think I understand popen2() behaviour

Steve Purcell stephen_purcell at yahoo.com
Mon Feb 12 13:54:15 EST 2001


Timothy Grant wrote:
> >>> import popen2
> >>> x,y = popen2.popen2('tail -f /var/log/messages')
> >>> tail: /var/log/messages: Permission denied
> tail: no files remaining
> 
> >>>
> 
> Now that was unexpected, as I would have thought that the error messages
> should have been hidden away in my file object y,

popen2 gives you (stdin, stdout) for the child process. You probably want
'popen3' instead if you want to grab stderr.

-Steve

-- 
Steve Purcell, Pythangelist
http://pyunit.sourceforge.net/
http://pyserv.sourceforge.net/
Available for consulting and training.
"Even snakes are afraid of snakes." -- Steven Wright




More information about the Python-list mailing list