Using popen in windows

Robert Cragie rcc at nospamthanks_jennic.com
Thu Apr 20 07:07:10 EDT 2000


I tried the following in Windows 98 as an experiment:

from win32pipe import popen
p = popen('dir','r')
str = p.read()
print str

It just hangs when trying to do the read, and I have to kill the shell off.
I have tried IDLE 0.5 and PythonWin and the 'DOS' command line, both do the
same. I am using Python 1.5.2, and the win32pipe.pyd DLL is dated 3rd May
1999.

I have done the equivalent on Linux and it works fine:

from os import popen
p = popen('ls','r')
str = p.read()
print str

Anyone got any ideas?

TIA

Robert Cragie





More information about the Python-list mailing list