On Sun, 8 Mar 2015 8:22 AM Marcus Ottosson <[email protected]> wrote:
Thanks a lot, guys. psutil is looking amazing so far. I mean, how cool is this? # Kill children of process id 1234 import psutil for child in psutil.Process(1234).children(): child.kill() For polling, I’m thinking something like this will suffice. psutil.Process(1234).wait() sys.exit() On windows its a heavy handed operation to get a parent process id I did find a pretty straightforward way to do this: import os os.getpid() Not heavy to get the pid of the current process. Heavy to do the whole parent process lookup. From the win32 calls, it looked like psutil needed to cache the ppid because it involves pulling all processes and comparing the id. psutil does it all in its windows specific code Until a better solution pops up, this fits the bill I think. Thanks! -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCGn0MFu1zvvqJLuuAVOv9e8ZP%2BXmHWJos8s9NfYgp08g%40mail.gmail.com <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCGn0MFu1zvvqJLuuAVOv9e8ZP%2BXmHWJos8s9NfYgp08g%40mail.gmail.com?utm_medium=email&utm_source=footer> . For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA18xqdJqPrHJfhG%3D9MwBrbvCgCvAGDwLCjT7kWig70uEA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
