ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activepython
activepython
Creating and terminating a process using win32process
by Mike Elkins other posts by this author
Nov 17 2005 2:55PM messages near this date
view in the new Beta List Site
Re: python com server clean up problem | Re: Creating and terminating a process using win32process
I'm trying to port some python code that uses the Popen3 class returned from
popen2.popen3 on linux. This isn't available on windows, so I thought I'd
try it using win32process.

I figured out a way to call win32process.CreateProcess that actually spawns
a process, but calling win32process.TerminateProcess on the handle it
returns fails with 'Access Denied'.

What would be the typical way someone would spawn a process and later kill
it?

Sample Code:
import win32process
si = win32process.STARTUP_INFO()
details = win32process.CreateProcess('foo.exe','foo.exe
',None,None,False,0,None,None,si)
win32process.TerminateProcess(details[0],99)
Attachments:
unknown1
unknown2
unknown3
unknown4

Thread:
Mike Elkins
Trent Mick

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved