How to do os.popen with write and read at the same time?

Moshe Zadka moshez at math.huji.ac.il
Tue Mar 14 00:31:53 EST 2000


On Mon, 13 Mar 2000, Benyang Tang wrote:

> 
> I like to do thing like:
> 
> stdin > grep 'something' >stdout
> 
> How do I access stdin and stdout in python?  
> os.popen accepts either 'w' or 'r' mode, but not both at the same time.

So try popen.popen2 instead...
--
Moshe Zadka <mzadka at geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com





More information about the Python-list mailing list