os.popen() and (IDLE, PythonWin) ?
mal at lemburg.com
Mon Nov 1 04:56:26 EST 1999
"M.-A. Lemburg" wrote:
> [os.popen('ver') fails under IDLE and PythonWin, yet works under "normal"
Ok, I found the FAQ entry on this:
7.13. Why doesn't os.popen() work in PythonWin on NT?
The reason that os.popen() doesn't work from within PythonWin is due to a bug in Microsoft's C Runtime
Library (CRT). The CRT assumes you have a Win32 console attached to the process.
You should use the win32pipe module's popen() instead which doesn't depend on having an attached Win32
f = win32pipe.popen('dir /c c:\\')
Under PythonWin this is no problem (although I wish os.popen would
automatically choose the different approach for me in the above
setup). Yet under IDLE I have a problem: win32 doesn't have to be
installed... is there some other workaround ?
Y2000: 60 days left
Python Pages: http://www.lemburg.com/python/
More information about the Python-list