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

Moshe Zadka moshez at
Tue Mar 14 06:31:53 CET 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>. -- we put the penguin in .com

More information about the Python-list mailing list