[python-win32] PID of a process created by win32com.client.Dispatch()

Bruce Webber bruce at brucewebber.us
Tue Mar 6 03:01:13 CET 2007


I've written a program which automates the running of Business Objects (a query generator and reporting tool). The command which creates the process (and the corresponding Python object) is:

boApp = win32com.client.Dispatch('BusinessObjects.Application')

This works fine, and I have successfully run the application. However, sometimes the Business Objects process hangs (perhaps because the query takes too long or perhaps due to some error in my code) and I would like to kill the process in Task Manager. If I am running this on my PC, it's easy to identify the process to kill. If, however, I'm running this on a server and there are other Business Objects processes running I cannot tell which process to end.

Upon calling Dispatch() I would like to log the PID of the process, so if I have to kill, I would know which one.

Is there a way to do this? (I have looked through the Python for Windows documentation and searched on the web, but have not found any answers.) Thanks.

--
Bruce Webber
bruce at brucewebber.us
http://brucewebber.us



More information about the Python-win32 mailing list