> I have some code that spawns processes using the "spawnv" > command this returns a process handle. > Can I use the process handle to retrieve the actual PID of > the process ? This is part of a test harness > and I need to be able have the actual PID to use against some output.
Good question! It's not immediately obvious how to do this simply, but at a pinch, maybe win32pdh or WMI could be used? Other (more painful) option is to use CreateProcess to spawn your process. The best Python implemented example of how to do this I know of is at http://svn.zope.org/*checkout*/Zope/trunk/lib/python/nt_svcutils/service.py? content-type=text%2Fplain - the main advantage is that you can redirect the output any place you like. Hope that helps. Mark _______________________________________________ Python-win32 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-win32
