[Twisted-Python] Python and Win32 command execution
![](https://secure.gravatar.com/avatar/4f39ce79f7733a002a78e99697670721.jpg?s=120&d=mm&r=g)
hello, I noticed your message with an example of using CreateProcess(): http://twistedmatrix.com/pipermail/twisted-python/2002-March/000882.html I actually only need a version of the os.system() command that does return the exit value. The problem is that under Windows 95 and 98 the return value if always zero, thus I don't know if the command actually worked. For my work on A-A-P (http://www.a-a-p.org) I do need to get the exit value. The key to solving the problem apparently is to avoid using command.com. It seems your example can be changed to redirect the stdout and stderr of the command, invoke CreateProcess() and obtain the exit value. But it's not that simple. Do you perhaps know a better solution? - Bram -- hundred-and-one symptoms of being an internet addict: 244. You use more than 20 passwords. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
On Tue, 31 Dec 2002 17:47:18 +0100 Bram Moolenaar <Bram@moolenaar.net> wrote:
Twisted's latest win32 process running code in twisted.internet.win32eventreactor, but it might be overkill for what you need. It's also kind of tied to the event loop. I'm not sure if I ever intergrated for getting exit value, but there is an API for it - http://aspn.activestate.com//ASPN/Python/Reference/Products/ActivePython/Pyt... -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python, Twisted, Zope and Java consulting ***> http://VoteNoWar.org -- vote/donate/volunteer <***
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
On Tue, 31 Dec 2002 17:47:18 +0100 Bram Moolenaar <Bram@moolenaar.net> wrote:
Twisted's latest win32 process running code in twisted.internet.win32eventreactor, but it might be overkill for what you need. It's also kind of tied to the event loop. I'm not sure if I ever intergrated for getting exit value, but there is an API for it - http://aspn.activestate.com//ASPN/Python/Reference/Products/ActivePython/Pyt... -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python, Twisted, Zope and Java consulting ***> http://VoteNoWar.org -- vote/donate/volunteer <***
participants (2)
-
Bram Moolenaar
-
Itamar Shtull-Trauring