Ret status technique popen, popen2 (NT)

Neil Hodgson neilh at scintilla.org
Fri Jun 16 10:21:50 EDT 2000


> Can anyone give me a pointer on how to monitor the status of win32pipe
> popen & popen2 calls? I want to get the return stat of the popen job
> and to be able to detect if the popen2 job worked/started.

  I've reimplemented popen using calldll and the bare Win32 API. Its
available from
http://www.scintilla.org/piper.zip
   The zip file contains Sam Rushing's calldll.pyd which provides access to
Win32, piper.py which implements a PipedCommand class which is roughly
equivalent to popen, and some test/example scaffolding. There is no popen2
or popen3 equivalent included although it shouldn't be too hard to implement
them. The exit status is available and the source can be modified to access
other information if needed.

   Its been tested on both Windows 95 and Windows 2000 and is based on C++
code that has been published and working for 18 months although the
translation to Python was done today. So there may be some bugs in the
translation.

   Neil





More information about the Python-list mailing list