How to terminate initalized standalone maya?

in my python idle … i av initialized maya standalone. i see task manager consuming high for this… after that i need to terminate/unload/destroy/kill/del the maya standalone modules that are initalized… how do i do that? i hv tried del to unloaded imported modules… no use!
not only this… after initializing maya in python idle… it throughs memory exception on python idle exit!

quit()

exit(), quit() or any modification of mc.quit(force=True) doesn’t seem to do it, at least for Maya 2008 (which our project is stuck with).

internet searches haven’t come up with a solid answer either.

if anyone does stumble across a working solution, pleas post.

thanks

subprocess.Popen([‘taskkill’, ‘/im’, ‘maya.exe’, ‘/f’])

(or whatever the exe name is instead of maya.exe)
(or use /pid and the pid instead of /im and maya.exe, if you know the pid of the executable)

I don’t always orphan processes, but when I do, I use taskkill.

Rob:
Yeah, taskkill is one of those good shell functions in Windows. Just like tasklist (of which one-one knows of).

And wtf did MS take all those good unix commands and rename all the command switches so I always feel like a dork when I can’t remember which switch did what…

Like findstr. It’s just like grep! But the syntax is 100% different. Argh, Hulk smash.

SamiV.

I have a little .bat in my system32 folder called ‘k.bat’ with the following in it:


taskkill /F /IM %1*

so all I have to do when I’m tired of an app is type ‘win-r > k may’ and it kills maya)

it’s pretty handy and faster then ctrl-shit-escaping =)