【发布时间】:2011-08-08 03:01:29
【问题描述】:
假设我正在运行一个 exe,它的名称是 myexe.exe。在 Windows 上,我可以在 Process Explorer 中看到 myexe.exe 的进程。使用Python如何获取myexe.exe的进程ID并关闭?
【问题讨论】:
-
是来自当前进程还是来自python shell?您可以从stackoverflow.com/questions/2703640/… 获取后者,或者如何从 python 中杀死进程:stackoverflow.com/questions/4214773/kill-process-with-python
-
您的问题已在此处得到解答。请不要重复发帖。 How can I find a process by name and kill using ctypes?。请记住,每次你重复发布时,Jon Skeet 都会杀死一只小猫。请想想小猫们。